author | harlekin <harlekin> | 2002-08-15 19:06:52 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-08-15 19:06:52 (UTC) |
commit | cff42f8a8808ef9fd9b65376649857e0e0c2ccc3 (patch) (unidiff) | |
tree | 7cf3cca6b2ebb35cd9ffc0ce8adc5568a27ad7d7 | |
parent | 8cd40434c7011022a8e1706698e5c5075681bd1e (diff) | |
download | opie-cff42f8a8808ef9fd9b65376649857e0e0c2ccc3.zip opie-cff42f8a8808ef9fd9b65376649857e0e0c2ccc3.tar.gz opie-cff42f8a8808ef9fd9b65376649857e0e0c2ccc3.tar.bz2 |
stop now working as supposed
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 4 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 8 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 2 |
4 files changed, 8 insertions, 7 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index 3b20873..d554141 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp | |||
@@ -126,96 +126,97 @@ Lib::Lib(XineVideoWidget* widget) { | |||
126 | m_audioOutput, m_config ); | 126 | m_audioOutput, m_config ); |
127 | // install the event handler | 127 | // install the event handler |
128 | xine_register_event_listener( m_xine, xine_event_handler, this ); | 128 | xine_register_event_listener( m_xine, xine_event_handler, this ); |
129 | } | 129 | } |
130 | 130 | ||
131 | Lib::~Lib() { | 131 | Lib::~Lib() { |
132 | delete m_config; | 132 | delete m_config; |
133 | xine_remove_event_listener( m_xine, xine_event_handler ); | 133 | xine_remove_event_listener( m_xine, xine_event_handler ); |
134 | xine_exit( m_xine ); | 134 | xine_exit( m_xine ); |
135 | delete m_videoOutput; | 135 | delete m_videoOutput; |
136 | //delete m_audioOutput; | 136 | //delete m_audioOutput; |
137 | 137 | ||
138 | } | 138 | } |
139 | 139 | ||
140 | void Lib::resize ( const QSize &s ) | 140 | void Lib::resize ( const QSize &s ) |
141 | { | 141 | { |
142 | if ( s. width ( ) && s. height ( )) { | 142 | if ( s. width ( ) && s. height ( )) { |
143 | ::null_set_gui_width( m_videoOutput, s. width() ); | 143 | ::null_set_gui_width( m_videoOutput, s. width() ); |
144 | ::null_set_gui_height(m_videoOutput, s. height() ); | 144 | ::null_set_gui_height(m_videoOutput, s. height() ); |
145 | } | 145 | } |
146 | } | 146 | } |
147 | 147 | ||
148 | QCString Lib::version() { | 148 | QCString Lib::version() { |
149 | QCString str( xine_get_str_version() ); | 149 | QCString str( xine_get_str_version() ); |
150 | return str; | 150 | return str; |
151 | }; | 151 | }; |
152 | 152 | ||
153 | int Lib::majorVersion() { | 153 | int Lib::majorVersion() { |
154 | return xine_get_major_version(); | 154 | return xine_get_major_version(); |
155 | } | 155 | } |
156 | int Lib::minorVersion() { | 156 | int Lib::minorVersion() { |
157 | return xine_get_minor_version(); | 157 | return xine_get_minor_version(); |
158 | }; | 158 | }; |
159 | 159 | ||
160 | int Lib::subVersion() { | 160 | int Lib::subVersion() { |
161 | return xine_get_sub_version(); | 161 | return xine_get_sub_version(); |
162 | } | 162 | } |
163 | int Lib::play( const QString& fileName, | 163 | int Lib::play( const QString& fileName, |
164 | int startPos, | 164 | int startPos, |
165 | int start_time ) { | 165 | int start_time ) { |
166 | QString str = fileName.stripWhiteSpace(); | 166 | QString str = fileName.stripWhiteSpace(); |
167 | //workaround OpiePlayer bug | 167 | //workaround OpiePlayer bug |
168 | if (str.right(1) == QString::fromLatin1("/") ) | 168 | if (str.right(1) == QString::fromLatin1("/") ) |
169 | str = str.mid( str.length() -1 ); | 169 | str = str.mid( str.length() -1 ); |
170 | return xine_play( m_xine, QFile::encodeName(str.utf8() ).data(), | 170 | return xine_play( m_xine, QFile::encodeName(str.utf8() ).data(), |
171 | startPos, start_time); | 171 | startPos, start_time); |
172 | } | 172 | } |
173 | void Lib::stop() { | 173 | void Lib::stop() { |
174 | qDebug("<<<<<<<< STOP IN LIB TRIGGERED >>>>>>>"); | ||
174 | xine_stop(m_xine ); | 175 | xine_stop(m_xine ); |
175 | } | 176 | } |
176 | void Lib::pause(){ | 177 | void Lib::pause(){ |
177 | xine_set_speed( m_xine, SPEED_PAUSE ); | 178 | xine_set_speed( m_xine, SPEED_PAUSE ); |
178 | } | 179 | } |
179 | int Lib::speed() { | 180 | int Lib::speed() { |
180 | return xine_get_speed( m_xine ); | 181 | return xine_get_speed( m_xine ); |
181 | } | 182 | } |
182 | void Lib::setSpeed( int speed ) { | 183 | void Lib::setSpeed( int speed ) { |
183 | xine_set_speed( m_xine, speed ); | 184 | xine_set_speed( m_xine, speed ); |
184 | } | 185 | } |
185 | int Lib::status(){ | 186 | int Lib::status(){ |
186 | return xine_get_status( m_xine ); | 187 | return xine_get_status( m_xine ); |
187 | } | 188 | } |
188 | int Lib::currentPosition(){ | 189 | int Lib::currentPosition(){ |
189 | return xine_get_current_position( m_xine ); | 190 | return xine_get_current_position( m_xine ); |
190 | } | 191 | } |
191 | int Lib::currentTime() { | 192 | int Lib::currentTime() { |
192 | return xine_get_current_time( m_xine ); | 193 | return xine_get_current_time( m_xine ); |
193 | }; | 194 | }; |
194 | int Lib::length() { | 195 | int Lib::length() { |
195 | return xine_get_stream_length( m_xine ); | 196 | return xine_get_stream_length( m_xine ); |
196 | } | 197 | } |
197 | bool Lib::isSeekable() { | 198 | bool Lib::isSeekable() { |
198 | return xine_is_stream_seekable(m_xine); | 199 | return xine_is_stream_seekable(m_xine); |
199 | } | 200 | } |
200 | Frame Lib::currentFrame() { | 201 | Frame Lib::currentFrame() { |
201 | Frame frame; | 202 | Frame frame; |
202 | return frame; | 203 | return frame; |
203 | }; | 204 | }; |
204 | int Lib::error() { | 205 | int Lib::error() { |
205 | return xine_get_error( m_xine ); | 206 | return xine_get_error( m_xine ); |
206 | }; | 207 | }; |
207 | void Lib::handleXineEvent( xine_event_t* t ) { | 208 | void Lib::handleXineEvent( xine_event_t* t ) { |
208 | if ( t->type == XINE_EVENT_PLAYBACK_FINISHED ) | 209 | if ( t->type == XINE_EVENT_PLAYBACK_FINISHED ) |
209 | emit stopped(); | 210 | emit stopped(); |
210 | } | 211 | } |
211 | void Lib::setShowVideo( bool video ) { | 212 | void Lib::setShowVideo( bool video ) { |
212 | m_video = video; | 213 | m_video = video; |
213 | ::null_set_show_video( m_videoOutput, video ); | 214 | ::null_set_show_video( m_videoOutput, video ); |
214 | } | 215 | } |
215 | bool Lib::isShowingVideo() { | 216 | bool Lib::isShowingVideo() { |
216 | return ::null_is_showing_video( m_videoOutput ); | 217 | return ::null_is_showing_video( m_videoOutput ); |
217 | } | 218 | } |
218 | void Lib::showVideoFullScreen( bool fullScreen ) { | 219 | void Lib::showVideoFullScreen( bool fullScreen ) { |
219 | ::null_set_fullscreen( m_videoOutput, fullScreen ); | 220 | ::null_set_fullscreen( m_videoOutput, fullScreen ); |
220 | } | 221 | } |
221 | bool Lib::isVideoFullScreen() { | 222 | bool Lib::isVideoFullScreen() { |
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index 51fbb8b..93819f2 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp | |||
@@ -3,120 +3,120 @@ | |||
3 | #include <qpe/resource.h> | 3 | #include <qpe/resource.h> |
4 | #include <qpe/config.h> | 4 | #include <qpe/config.h> |
5 | 5 | ||
6 | #include <qmainwindow.h> | 6 | #include <qmainwindow.h> |
7 | #include <qmessagebox.h> | 7 | #include <qmessagebox.h> |
8 | #include <qwidgetstack.h> | 8 | #include <qwidgetstack.h> |
9 | #include <qfile.h> | 9 | #include <qfile.h> |
10 | 10 | ||
11 | #include "mediaplayer.h" | 11 | #include "mediaplayer.h" |
12 | #include "playlistwidget.h" | 12 | #include "playlistwidget.h" |
13 | #include "audiowidget.h" | 13 | #include "audiowidget.h" |
14 | #include "videowidget.h" | 14 | #include "videowidget.h" |
15 | #include "volumecontrol.h" | 15 | #include "volumecontrol.h" |
16 | 16 | ||
17 | #include "mediaplayerstate.h" | 17 | #include "mediaplayerstate.h" |
18 | 18 | ||
19 | 19 | ||
20 | 20 | ||
21 | extern AudioWidget *audioUI; | 21 | extern AudioWidget *audioUI; |
22 | extern VideoWidget *videoUI; | 22 | extern VideoWidget *videoUI; |
23 | extern PlayListWidget *playList; | 23 | extern PlayListWidget *playList; |
24 | extern MediaPlayerState *mediaPlayerState; | 24 | extern MediaPlayerState *mediaPlayerState; |
25 | 25 | ||
26 | 26 | ||
27 | MediaPlayer::MediaPlayer( QObject *parent, const char *name ) | 27 | MediaPlayer::MediaPlayer( QObject *parent, const char *name ) |
28 | : QObject( parent, name ), volumeDirection( 0 ), currentFile( NULL ) { | 28 | : QObject( parent, name ), volumeDirection( 0 ), currentFile( NULL ) { |
29 | 29 | ||
30 | 30 | ||
31 | xineControl = new XineControl(); | 31 | xineControl = new XineControl(); |
32 | // QPEApplication::grabKeyboard(); // EVIL | 32 | // QPEApplication::grabKeyboard(); // EVIL |
33 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | 33 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); |
34 | 34 | ||
35 | connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( setPlaying( bool ) ) ); | 35 | connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( setPlaying( bool ) ) ); |
36 | 36 | ||
37 | connect( mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pauseCheck( bool ) ) ); | 37 | connect( mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pauseCheck( bool ) ) ); |
38 | 38 | ||
39 | connect( mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) ); | 39 | connect( mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) ); |
40 | connect( mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) ); | 40 | connect( mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) ); |
41 | 41 | ||
42 | connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); | 42 | connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); |
43 | connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); | 43 | connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); |
44 | connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); | 44 | connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); |
45 | connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); | 45 | connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); |
46 | 46 | ||
47 | connect( videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); | 47 | connect( videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); |
48 | connect( videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); | 48 | connect( videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); |
49 | connect( videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); | 49 | connect( videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); |
50 | connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); | 50 | connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); |
51 | 51 | ||
52 | volControl = new VolumeControl; | 52 | volControl = new VolumeControl; |
53 | 53 | ||
54 | } | 54 | } |
55 | 55 | ||
56 | MediaPlayer::~MediaPlayer() { | 56 | MediaPlayer::~MediaPlayer() { |
57 | delete xineControl; | 57 | delete xineControl; |
58 | delete volControl; | 58 | delete volControl; |
59 | } | 59 | } |
60 | 60 | ||
61 | void MediaPlayer::pauseCheck( bool b ) { | 61 | void MediaPlayer::pauseCheck( bool b ) { |
62 | if ( b && !mediaPlayerState->playing() ) { | 62 | if ( b && !mediaPlayerState->playing() ) { |
63 | mediaPlayerState->setPaused( FALSE ); | 63 | mediaPlayerState->setPaused( FALSE ); |
64 | } | 64 | } |
65 | } | 65 | } |
66 | 66 | ||
67 | void MediaPlayer::play() { | 67 | void MediaPlayer::play() { |
68 | mediaPlayerState->setPlaying( FALSE ); | 68 | mediaPlayerState->setPlaying( FALSE ); |
69 | mediaPlayerState->setPlaying( TRUE ); | 69 | mediaPlayerState->setPlaying( TRUE ); |
70 | } | 70 | } |
71 | 71 | ||
72 | void MediaPlayer::setPlaying( bool play ) { | 72 | void MediaPlayer::setPlaying( bool play ) { |
73 | if ( !play ) { | 73 | if ( !play ) { |
74 | mediaPlayerState->setPaused( FALSE ); | 74 | //mediaPlayerState->setPaused( TRUE ); |
75 | return; | 75 | return; |
76 | } | 76 | } |
77 | 77 | ||
78 | if ( mediaPlayerState->paused() ) { | 78 | if ( mediaPlayerState->paused() ) { |
79 | mediaPlayerState->setPaused( FALSE ); | 79 | mediaPlayerState->setPaused( FALSE ); |
80 | return; | 80 | return; |
81 | } | 81 | } |
82 | 82 | ||
83 | const DocLnk *playListCurrent = playList->current(); | 83 | const DocLnk *playListCurrent = playList->current(); |
84 | if ( playListCurrent != NULL ) { | 84 | if ( playListCurrent != NULL ) { |
85 | currentFile = playListCurrent; | 85 | currentFile = playListCurrent; |
86 | } | 86 | } |
87 | 87 | ||
88 | xineControl->play( currentFile->file() ); | 88 | xineControl->play( currentFile->file() ); |
89 | 89 | ||
90 | xineControl->length(); | 90 | xineControl->length(); |
91 | long seconds = mediaPlayerState->length();// | 91 | long seconds = mediaPlayerState->length();// |
92 | QString time; time.sprintf("%li:%02i", seconds/60, (int)seconds%60 ); | 92 | QString time; time.sprintf("%li:%02i", seconds/60, (int)seconds%60 ); |
93 | qDebug(time); | 93 | qDebug(time); |
94 | 94 | ||
95 | QString tickerText; | 95 | QString tickerText; |
96 | if( currentFile->file().left(4) == "http" ) | 96 | if( currentFile->file().left(4) == "http" ) |
97 | tickerText= tr( " File: " ) + currentFile->name(); | 97 | tickerText= tr( " File: " ) + currentFile->name(); |
98 | else | 98 | else |
99 | tickerText = tr( " File: " ) + currentFile->name() + tr(", Length: ") + time; | 99 | tickerText = tr( " File: " ) + currentFile->name() + tr(", Length: ") + time; |
100 | 100 | ||
101 | // QString fileInfo = mediaPlayerState->curDecoder()->fileInfo(); | 101 | // QString fileInfo = mediaPlayerState->curDecoder()->fileInfo(); |
102 | 102 | ||
103 | // if ( !fileInfo.isEmpty() ) | 103 | // if ( !fileInfo.isEmpty() ) |
104 | // tickerText += ", " + fileInfo; | 104 | // tickerText += ", " + fileInfo; |
105 | // audioUI->setTickerText( tickerText + "." ); | 105 | // audioUI->setTickerText( tickerText + "." ); |
106 | 106 | ||
107 | audioUI->setTickerText( currentFile->file( ) ); | 107 | audioUI->setTickerText( currentFile->file( ) ); |
108 | 108 | ||
109 | } | 109 | } |
110 | 110 | ||
111 | 111 | ||
112 | void MediaPlayer::prev() { | 112 | void MediaPlayer::prev() { |
113 | if ( playList->prev() ) { | 113 | if ( playList->prev() ) { |
114 | play(); | 114 | play(); |
115 | } else if ( mediaPlayerState->looping() ) { | 115 | } else if ( mediaPlayerState->looping() ) { |
116 | if ( playList->last() ) { | 116 | if ( playList->last() ) { |
117 | play(); | 117 | play(); |
118 | } | 118 | } |
119 | } else { | 119 | } else { |
120 | mediaPlayerState->setList(); | 120 | mediaPlayerState->setList(); |
121 | } | 121 | } |
122 | } | 122 | } |
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index c210ffb..77e2095 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -640,97 +640,97 @@ void PlayListWidget::addSelected() { | |||
640 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); | 640 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); |
641 | // int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); | 641 | // int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); |
642 | 642 | ||
643 | switch (tabWidget->currentPageIndex()) { | 643 | switch (tabWidget->currentPageIndex()) { |
644 | case 0: //playlist | 644 | case 0: //playlist |
645 | break; | 645 | break; |
646 | case 1: { //audio | 646 | case 1: { //audio |
647 | QListViewItemIterator it( audioView ); | 647 | QListViewItemIterator it( audioView ); |
648 | // iterate through all items of the listview | 648 | // iterate through all items of the listview |
649 | for ( ; it.current(); ++it ) { | 649 | for ( ; it.current(); ++it ) { |
650 | if ( it.current()->isSelected() ) { | 650 | if ( it.current()->isSelected() ) { |
651 | QListIterator<DocLnk> dit( files.children() ); | 651 | QListIterator<DocLnk> dit( files.children() ); |
652 | for ( ; dit.current(); ++dit ) { | 652 | for ( ; dit.current(); ++dit ) { |
653 | if( dit.current()->name() == it.current()->text(0) ) { | 653 | if( dit.current()->name() == it.current()->text(0) ) { |
654 | d->selectedFiles->addToSelection( **dit ); | 654 | d->selectedFiles->addToSelection( **dit ); |
655 | } | 655 | } |
656 | } | 656 | } |
657 | audioView->setSelected( it.current(),FALSE); | 657 | audioView->setSelected( it.current(),FALSE); |
658 | } | 658 | } |
659 | } | 659 | } |
660 | tabWidget->setCurrentPage(0); | 660 | tabWidget->setCurrentPage(0); |
661 | } | 661 | } |
662 | break; | 662 | break; |
663 | case 2: { // video | 663 | case 2: { // video |
664 | QListViewItemIterator it( videoView ); | 664 | QListViewItemIterator it( videoView ); |
665 | // iterate through all items of the listview | 665 | // iterate through all items of the listview |
666 | for ( ; it.current(); ++it ) { | 666 | for ( ; it.current(); ++it ) { |
667 | if ( it.current()->isSelected() ) { | 667 | if ( it.current()->isSelected() ) { |
668 | QListIterator<DocLnk> dit( vFiles.children() ); | 668 | QListIterator<DocLnk> dit( vFiles.children() ); |
669 | for ( ; dit.current(); ++dit ) { | 669 | for ( ; dit.current(); ++dit ) { |
670 | if( dit.current()->name() == it.current()->text(0) ) { | 670 | if( dit.current()->name() == it.current()->text(0) ) { |
671 | d->selectedFiles->addToSelection( **dit ); | 671 | d->selectedFiles->addToSelection( **dit ); |
672 | } | 672 | } |
673 | } | 673 | } |
674 | videoView->setSelected( it.current(),FALSE); | 674 | videoView->setSelected( it.current(),FALSE); |
675 | } | 675 | } |
676 | } | 676 | } |
677 | tabWidget->setCurrentPage(0); | 677 | tabWidget->setCurrentPage(0); |
678 | } | 678 | } |
679 | break; | 679 | break; |
680 | }; | 680 | }; |
681 | } | 681 | } |
682 | 682 | ||
683 | void PlayListWidget::removeSelected() { | 683 | void PlayListWidget::removeSelected() { |
684 | d->selectedFiles->removeSelected( ); | 684 | d->selectedFiles->removeSelected( ); |
685 | } | 685 | } |
686 | 686 | ||
687 | void PlayListWidget::playIt( QListViewItem *it) { | 687 | void PlayListWidget::playIt( QListViewItem *it) { |
688 | if(it==NULL) return; | 688 | // if(it==NULL) return; |
689 | qDebug("playIt"); | 689 | qDebug("playIt"); |
690 | mediaPlayerState->setPlaying(FALSE); | 690 | mediaPlayerState->setPlaying(FALSE); |
691 | mediaPlayerState->setPlaying(TRUE); | 691 | mediaPlayerState->setPlaying(TRUE); |
692 | d->selectedFiles->unSelect(); | 692 | d->selectedFiles->unSelect(); |
693 | } | 693 | } |
694 | 694 | ||
695 | void PlayListWidget::addToSelection( QListViewItem *it) { | 695 | void PlayListWidget::addToSelection( QListViewItem *it) { |
696 | d->setDocumentUsed = FALSE; | 696 | d->setDocumentUsed = FALSE; |
697 | 697 | ||
698 | if(it) { | 698 | if(it) { |
699 | switch (tabWidget->currentPageIndex()) { | 699 | switch (tabWidget->currentPageIndex()) { |
700 | case 1: { | 700 | case 1: { |
701 | QListIterator<DocLnk> dit( files.children() ); | 701 | QListIterator<DocLnk> dit( files.children() ); |
702 | for ( ; dit.current(); ++dit ) { | 702 | for ( ; dit.current(); ++dit ) { |
703 | if( dit.current()->name() == it->text(0)) { | 703 | if( dit.current()->name() == it->text(0)) { |
704 | d->selectedFiles->addToSelection( **dit ); | 704 | d->selectedFiles->addToSelection( **dit ); |
705 | } | 705 | } |
706 | } | 706 | } |
707 | } | 707 | } |
708 | break; | 708 | break; |
709 | case 2: { | 709 | case 2: { |
710 | QListIterator<DocLnk> dit( vFiles.children() ); | 710 | QListIterator<DocLnk> dit( vFiles.children() ); |
711 | for ( ; dit.current(); ++dit ) { | 711 | for ( ; dit.current(); ++dit ) { |
712 | if( dit.current()->name() == it->text(0)) { | 712 | if( dit.current()->name() == it->text(0)) { |
713 | d->selectedFiles->addToSelection( **dit ); | 713 | d->selectedFiles->addToSelection( **dit ); |
714 | } | 714 | } |
715 | } | 715 | } |
716 | } | 716 | } |
717 | break; | 717 | break; |
718 | case 0: | 718 | case 0: |
719 | break; | 719 | break; |
720 | }; | 720 | }; |
721 | tabWidget->setCurrentPage(0); | 721 | tabWidget->setCurrentPage(0); |
722 | } | 722 | } |
723 | } | 723 | } |
724 | 724 | ||
725 | void PlayListWidget::tabChanged(QWidget *) { | 725 | void PlayListWidget::tabChanged(QWidget *) { |
726 | 726 | ||
727 | switch ( tabWidget->currentPageIndex()) { | 727 | switch ( tabWidget->currentPageIndex()) { |
728 | case 0: | 728 | case 0: |
729 | { | 729 | { |
730 | if( !tbDeletePlaylist->isHidden()) | 730 | if( !tbDeletePlaylist->isHidden()) |
731 | tbDeletePlaylist->hide(); | 731 | tbDeletePlaylist->hide(); |
732 | d->tbRemoveFromList->setEnabled(TRUE); | 732 | d->tbRemoveFromList->setEnabled(TRUE); |
733 | d->tbAddToList->setEnabled(FALSE); | 733 | d->tbAddToList->setEnabled(FALSE); |
734 | } | 734 | } |
735 | break; | 735 | break; |
736 | case 1: | 736 | case 1: |
@@ -1188,98 +1188,98 @@ void PlayListWidget::readPls(const QString &filename) { | |||
1188 | if(f.open(IO_ReadOnly)) { | 1188 | if(f.open(IO_ReadOnly)) { |
1189 | QTextStream t(&f); | 1189 | QTextStream t(&f); |
1190 | QString s;//, first, second; | 1190 | QString s;//, first, second; |
1191 | int i=0; | 1191 | int i=0; |
1192 | while ( !t.atEnd()) { | 1192 | while ( !t.atEnd()) { |
1193 | s=t.readLine(); | 1193 | s=t.readLine(); |
1194 | if(s.left(4) == "File") { | 1194 | if(s.left(4) == "File") { |
1195 | s=s.right(s.length() - 6); | 1195 | s=s.right(s.length() - 6); |
1196 | s.replace(QRegExp("%20")," "); | 1196 | s.replace(QRegExp("%20")," "); |
1197 | qDebug("adding "+s+" to playlist"); | 1197 | qDebug("adding "+s+" to playlist"); |
1198 | // numberofentries=2 | 1198 | // numberofentries=2 |
1199 | // File1=http | 1199 | // File1=http |
1200 | // Title | 1200 | // Title |
1201 | // Length | 1201 | // Length |
1202 | // Version | 1202 | // Version |
1203 | // File2=http | 1203 | // File2=http |
1204 | s=s.replace( QRegExp("\\"),"/"); | 1204 | s=s.replace( QRegExp("\\"),"/"); |
1205 | DocLnk lnk( s ); | 1205 | DocLnk lnk( s ); |
1206 | QFileInfo f(s); | 1206 | QFileInfo f(s); |
1207 | QString name = f.baseName(); | 1207 | QString name = f.baseName(); |
1208 | if(name.left(4)=="http") | 1208 | if(name.left(4)=="http") |
1209 | name = s.right( s.length() - 7); | 1209 | name = s.right( s.length() - 7); |
1210 | else | 1210 | else |
1211 | name=s; | 1211 | name=s; |
1212 | name = name.right(name.length()-name.findRev("\\",-1,TRUE)-1); | 1212 | name = name.right(name.length()-name.findRev("\\",-1,TRUE)-1); |
1213 | lnk.setName( name); | 1213 | lnk.setName( name); |
1214 | if(s.at(s.length()-4) == '.') // if this is probably a file | 1214 | if(s.at(s.length()-4) == '.') // if this is probably a file |
1215 | lnk.setFile( s); | 1215 | lnk.setFile( s); |
1216 | else { //if its a url | 1216 | else { //if its a url |
1217 | if( name.right(1).find('/') == -1) | 1217 | if( name.right(1).find('/') == -1) |
1218 | s+="/"; | 1218 | s+="/"; |
1219 | lnk.setFile( s); | 1219 | lnk.setFile( s); |
1220 | } | 1220 | } |
1221 | lnk.setType("audio/x-mpegurl"); | 1221 | lnk.setType("audio/x-mpegurl"); |
1222 | 1222 | ||
1223 | qDebug("DocLnk add "+name); | 1223 | qDebug("DocLnk add "+name); |
1224 | d->selectedFiles->addToSelection( lnk); | 1224 | d->selectedFiles->addToSelection( lnk); |
1225 | } | 1225 | } |
1226 | } | 1226 | } |
1227 | i++; | 1227 | i++; |
1228 | } | 1228 | } |
1229 | } | 1229 | } |
1230 | 1230 | ||
1231 | void PlayListWidget::pmViewActivated(int index) { | 1231 | void PlayListWidget::pmViewActivated(int index) { |
1232 | qDebug("%d", index); | 1232 | qDebug("%d", index); |
1233 | switch(index) { | 1233 | switch(index) { |
1234 | case -16: | 1234 | case -16: |
1235 | { | 1235 | { |
1236 | 1236 | ||
1237 | mediaPlayerState->toggleFullscreen(); | 1237 | mediaPlayerState->toggleFullscreen(); |
1238 | bool b=mediaPlayerState->fullscreen(); | 1238 | bool b=mediaPlayerState->fullscreen(); |
1239 | pmView->setItemChecked( index,b); | 1239 | pmView->setItemChecked( index,b); |
1240 | Config cfg( "OpiePlayer" ); | 1240 | Config cfg( "OpiePlayer" ); |
1241 | cfg.writeEntry("FullScreen", b); | 1241 | cfg.writeEntry("FullScreen", b); |
1242 | 1242 | ||
1243 | } | 1243 | } |
1244 | break; | 1244 | break; |
1245 | }; | 1245 | }; |
1246 | } | 1246 | } |
1247 | 1247 | ||
1248 | void PlayListWidget::populateSkinsMenu() { | 1248 | void PlayListWidget::populateSkinsMenu() { |
1249 | int item=0; | 1249 | int item=0; |
1250 | defaultSkinIndex=0; | 1250 | defaultSkinIndex=0; |
1251 | QString skinName; | 1251 | QString skinName; |
1252 | Config cfg( "OpiePlayer" ); | 1252 | Config cfg( "OpiePlayer" ); |
1253 | cfg.setGroup("Options"); | 1253 | cfg.setGroup("Options"); |
1254 | QString skin = cfg.readEntry("Skin","default"); | 1254 | QString skin = cfg.readEntry("Skin","default"); |
1255 | 1255 | ||
1256 | QDir skinsDir(QPEApplication::qpeDir()+"/pics/opieplayer2/skins"); | 1256 | QDir skinsDir(QPEApplication::qpeDir()+"/pics/opieplayer2/skins"); |
1257 | skinsDir.setFilter( QDir::Dirs); | 1257 | skinsDir.setFilter( QDir::Dirs); |
1258 | skinsDir.setSorting(QDir::Name); | 1258 | skinsDir.setSorting(QDir::Name); |
1259 | const QFileInfoList *skinslist = skinsDir.entryInfoList(); | 1259 | const QFileInfoList *skinslist = skinsDir.entryInfoList(); |
1260 | QFileInfoListIterator it( *skinslist ); | 1260 | QFileInfoListIterator it( *skinslist ); |
1261 | QFileInfo *fi; | 1261 | QFileInfo *fi; |
1262 | while ( (fi=it.current()) ) { | 1262 | while ( (fi=it.current()) ) { |
1263 | skinName = fi->fileName(); | 1263 | skinName = fi->fileName(); |
1264 | qDebug( fi->fileName()); | 1264 | qDebug( fi->fileName()); |
1265 | if( skinName != "." && skinName != ".." && skinName !="CVS") | 1265 | if( skinName != "." && skinName != ".." && skinName !="CVS") |
1266 | item = skinsMenu->insertItem( fi->fileName()); | 1266 | item = skinsMenu->insertItem( fi->fileName()); |
1267 | if( skinName == "default") | 1267 | if( skinName == "default") |
1268 | defaultSkinIndex = item; | 1268 | defaultSkinIndex = item; |
1269 | if( skinName == skin) | 1269 | if( skinName == skin) |
1270 | skinsMenu->setItemChecked( item, TRUE); | 1270 | skinsMenu->setItemChecked( item, TRUE); |
1271 | 1271 | ||
1272 | ++it; | 1272 | ++it; |
1273 | } | 1273 | } |
1274 | } | 1274 | } |
1275 | 1275 | ||
1276 | void PlayListWidget::skinsMenuActivated(int item) { | 1276 | void PlayListWidget::skinsMenuActivated(int item) { |
1277 | for(int i = defaultSkinIndex; i > defaultSkinIndex - skinsMenu->count(); i--) { | 1277 | for(int i = defaultSkinIndex; i > defaultSkinIndex - skinsMenu->count(); i--) { |
1278 | skinsMenu->setItemChecked( i, FALSE); | 1278 | skinsMenu->setItemChecked( i, FALSE); |
1279 | } | 1279 | } |
1280 | skinsMenu->setItemChecked( item, TRUE); | 1280 | skinsMenu->setItemChecked( item, TRUE); |
1281 | 1281 | ||
1282 | Config cfg( "OpiePlayer" ); | 1282 | Config cfg( "OpiePlayer" ); |
1283 | cfg.setGroup("Options"); | 1283 | cfg.setGroup("Options"); |
1284 | cfg.writeEntry("Skin", skinsMenu->text( item)); | 1284 | cfg.writeEntry("Skin", skinsMenu->text( item)); |
1285 | } | 1285 | } |
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 17112a2..8fd2743 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp | |||
@@ -71,97 +71,97 @@ void XineControl::play( const QString& fileName ) { | |||
71 | hasVideoChannel=FALSE; | 71 | hasVideoChannel=FALSE; |
72 | hasAudioChannel=FALSE; | 72 | hasAudioChannel=FALSE; |
73 | m_fileName = fileName; | 73 | m_fileName = fileName; |
74 | libXine->play( fileName ); | 74 | libXine->play( fileName ); |
75 | mediaPlayerState->setPlaying( true ); | 75 | mediaPlayerState->setPlaying( true ); |
76 | // default to audio view until we know how to handle video | 76 | // default to audio view until we know how to handle video |
77 | // MediaDetect mdetect; | 77 | // MediaDetect mdetect; |
78 | char whichGui = mdetect.videoOrAudio( fileName ); | 78 | char whichGui = mdetect.videoOrAudio( fileName ); |
79 | if (whichGui == 'f') { | 79 | if (whichGui == 'f') { |
80 | qDebug("Nicht erkannter Dateityp"); | 80 | qDebug("Nicht erkannter Dateityp"); |
81 | return; | 81 | return; |
82 | } | 82 | } |
83 | 83 | ||
84 | if (whichGui == 'a') { | 84 | if (whichGui == 'a') { |
85 | libXine->setShowVideo( false ); | 85 | libXine->setShowVideo( false ); |
86 | hasAudioChannel=TRUE; | 86 | hasAudioChannel=TRUE; |
87 | } else { | 87 | } else { |
88 | libXine->setShowVideo( true ); | 88 | libXine->setShowVideo( true ); |
89 | hasVideoChannel=TRUE; | 89 | hasVideoChannel=TRUE; |
90 | } | 90 | } |
91 | 91 | ||
92 | // determine if slider is shown | 92 | // determine if slider is shown |
93 | // mediaPlayerState->setIsStreaming( mdetect.isStreaming( fileName ) ); | 93 | // mediaPlayerState->setIsStreaming( mdetect.isStreaming( fileName ) ); |
94 | mediaPlayerState->setIsStreaming( !libXine->isSeekable() ); | 94 | mediaPlayerState->setIsStreaming( !libXine->isSeekable() ); |
95 | // which gui (video / audio) | 95 | // which gui (video / audio) |
96 | mediaPlayerState->setView( whichGui ); | 96 | mediaPlayerState->setView( whichGui ); |
97 | 97 | ||
98 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 98 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
99 | if ( !disabledSuspendScreenSaver ) { | 99 | if ( !disabledSuspendScreenSaver ) { |
100 | disabledSuspendScreenSaver = TRUE; | 100 | disabledSuspendScreenSaver = TRUE; |
101 | // Stop the screen from blanking and power saving state | 101 | // Stop the screen from blanking and power saving state |
102 | QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) | 102 | QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) |
103 | << ( whichGui == 'v' ? QPEApplication::Disable : QPEApplication::DisableSuspend ); | 103 | << ( whichGui == 'v' ? QPEApplication::Disable : QPEApplication::DisableSuspend ); |
104 | } | 104 | } |
105 | #endif | 105 | #endif |
106 | 106 | ||
107 | length(); | 107 | length(); |
108 | position(); | 108 | position(); |
109 | } | 109 | } |
110 | 110 | ||
111 | void XineControl::nextMedia() { | 111 | void XineControl::nextMedia() { |
112 | mediaPlayerState->setNext(); | 112 | mediaPlayerState->setNext(); |
113 | } | 113 | } |
114 | 114 | ||
115 | void XineControl::stop( bool isSet ) { | 115 | void XineControl::stop( bool isSet ) { |
116 | if ( !isSet) { | 116 | if ( !isSet) { |
117 | libXine->stop( ); | 117 | libXine->stop( ); |
118 | mediaPlayerState->setList(); | 118 | mediaPlayerState->setList(); |
119 | //mediaPlayerState->setPlaying( false ); | 119 | // mediaPlayerState->setPlaying( false ); |
120 | 120 | ||
121 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 121 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
122 | if ( disabledSuspendScreenSaver ) { | 122 | if ( disabledSuspendScreenSaver ) { |
123 | disabledSuspendScreenSaver = FALSE; | 123 | disabledSuspendScreenSaver = FALSE; |
124 | // Re-enable the suspend mode | 124 | // Re-enable the suspend mode |
125 | QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; | 125 | QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; |
126 | } | 126 | } |
127 | #endif | 127 | #endif |
128 | 128 | ||
129 | } else { | 129 | } else { |
130 | // play again | 130 | // play again |
131 | } | 131 | } |
132 | } | 132 | } |
133 | 133 | ||
134 | /** | 134 | /** |
135 | * Pause playback | 135 | * Pause playback |
136 | * @isSet | 136 | * @isSet |
137 | */ | 137 | */ |
138 | void XineControl::pause( bool isSet) { | 138 | void XineControl::pause( bool isSet) { |
139 | if (isSet) { | 139 | if (isSet) { |
140 | libXine->pause(); | 140 | libXine->pause(); |
141 | } else { | 141 | } else { |
142 | libXine->play( m_fileName, 0, m_currentTime); | 142 | libXine->play( m_fileName, 0, m_currentTime); |
143 | } | 143 | } |
144 | } | 144 | } |
145 | 145 | ||
146 | 146 | ||
147 | /** | 147 | /** |
148 | * get current time in playback | 148 | * get current time in playback |
149 | */ | 149 | */ |
150 | long XineControl::currentTime() { | 150 | long XineControl::currentTime() { |
151 | // todo: jede sekunde überprüfen | 151 | // todo: jede sekunde überprüfen |
152 | m_currentTime = libXine->currentTime(); | 152 | m_currentTime = libXine->currentTime(); |
153 | return m_currentTime; | 153 | return m_currentTime; |
154 | QTimer::singleShot( 1000, this, SLOT( currentTime() ) ); | 154 | QTimer::singleShot( 1000, this, SLOT( currentTime() ) ); |
155 | } | 155 | } |
156 | 156 | ||
157 | /** | 157 | /** |
158 | * Set the length of the media file | 158 | * Set the length of the media file |
159 | */ | 159 | */ |
160 | void XineControl::length() { | 160 | void XineControl::length() { |
161 | m_length = libXine->length(); | 161 | m_length = libXine->length(); |
162 | mediaPlayerState->setLength( m_length ); | 162 | mediaPlayerState->setLength( m_length ); |
163 | } | 163 | } |
164 | 164 | ||
165 | 165 | ||
166 | /** | 166 | /** |
167 | * Reports the position the xine backend is at right now | 167 | * Reports the position the xine backend is at right now |