-rw-r--r-- | core/multimedia/opieplayer/audiodevice.cpp | 16 | ||||
-rw-r--r-- | core/multimedia/opieplayer/audiowidget.cpp | 31 | ||||
-rw-r--r-- | core/multimedia/opieplayer/loopcontrol.cpp | 24 | ||||
-rw-r--r-- | core/multimedia/opieplayer/loopcontrol_threaded.cpp | 18 | ||||
-rw-r--r-- | core/multimedia/opieplayer/mediaplayer.cpp | 6 | ||||
-rw-r--r-- | core/multimedia/opieplayer/mediaplayerstate.cpp | 2 | ||||
-rw-r--r-- | core/multimedia/opieplayer/om3u.cpp | 4 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistselection.cpp | 2 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 142 | ||||
-rw-r--r-- | core/multimedia/opieplayer/videowidget.cpp | 14 |
10 files changed, 117 insertions, 142 deletions
diff --git a/core/multimedia/opieplayer/audiodevice.cpp b/core/multimedia/opieplayer/audiodevice.cpp index 73e41dc..d01d2ba 100644 --- a/core/multimedia/opieplayer/audiodevice.cpp +++ b/core/multimedia/opieplayer/audiodevice.cpp @@ -148,5 +148,5 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume, AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { - qDebug("creating new audio device"); + // qDebug("creating new audio device"); // QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; d = new AudioDevicePrivate; @@ -154,10 +154,10 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { d->channels = chs; d->bytesPerSample = bps; - qDebug("%d",bps); + // qDebug("%d",bps); int format=0; if( bps == 8) format = AFMT_U8; else if( bps <= 0) format = AFMT_S16_LE; else format = AFMT_S16_LE; - qDebug("AD- freq %d, channels %d, b/sample %d, bitrate %d",f,chs,bps,format); + // qDebug("AD- freq %d, channels %d, b/sample %d, bitrate %d",f,chs,bps,format); connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); @@ -192,8 +192,8 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { if(ioctl( d->handle, SNDCTL_DSP_SETFMT, & format )==-1) perror("ioctl(\"SNDCTL_DSP_SETFMT\")"); - qDebug("freq %d", d->frequency); + // qDebug("freq %d", d->frequency); if(ioctl( d->handle, SNDCTL_DSP_SPEED, &d->frequency )==-1) perror("ioctl(\"SNDCTL_DSP_SPEED\")"); - qDebug("channels %d",d->channels); + // qDebug("channels %d",d->channels); if ( ioctl( d->handle, SNDCTL_DSP_CHANNELS, &d->channels ) == -1 ) { d->channels = ( d->channels == 1 ) ? 2 : d->channels; @@ -219,5 +219,5 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { AudioDevice::~AudioDevice() { - qDebug("destryo audiodevice"); + // qDebug("destryo audiodevice"); // QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; @@ -243,5 +243,5 @@ void AudioDevice::write( char *buffer, unsigned int length ) if ( t<0 ) t = 0; if ( t != (int)length) { - qDebug("Ahhh!! memcpys 1"); + // qDebug("Ahhh!! memcpys 1"); memcpy(d->unwrittenBuffer,buffer+t,length-t); d->unwritten = length-t; @@ -306,5 +306,5 @@ int AudioDevice::bytesWritten() { int buffered = 0; if ( ioctl( d->handle, SNDCTL_DSP_GETODELAY, &buffered ) ) { - qDebug( "failed to get audio device position" ); + // qDebug( "failed to get audio device position" ); return -1; } diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp index a1973e9..b187cb4 100644 --- a/core/multimedia/opieplayer/audiowidget.cpp +++ b/core/multimedia/opieplayer/audiowidget.cpp @@ -77,5 +77,5 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : { setCaption( tr("OpiePlayer") ); - qDebug("<<<<<audioWidget"); + // qDebug("<<<<<audioWidget"); Config cfg("OpiePlayer"); @@ -91,5 +91,5 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : skinPath = "opieplayer2/skins/default"; - qDebug("skin path " + skinPath); + // qDebug("skin path " + skinPath); pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); @@ -161,20 +161,21 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : // setPaused( mediaPlayerState->paused() ); setPlaying( mediaPlayerState->playing() ); - +this->setFocus(); } AudioWidget::~AudioWidget() { + // setPlaying( false); for ( int i = 0; i < 10; i++ ) { - delete buttonPixUp[i]; - delete buttonPixDown[i]; + if(buttonPixUp[i]) delete buttonPixUp[i]; + if(buttonPixDown[i]) delete buttonPixDown[i]; } - delete pixBg; - delete imgUp; - delete imgDn; - delete imgButtonMask; + if(pixBg) delete pixBg; + if(imgUp) delete imgUp; + if(imgDn) delete imgDn; + if(imgButtonMask) delete imgButtonMask; for ( int i = 0; i < 10; i++ ) { - delete masks[i]; + if(masks[i]) delete masks[i]; } } @@ -280,4 +281,5 @@ void AudioWidget::setView( char view ) { hide(); } + } @@ -291,4 +293,5 @@ static QString timeAsString( long length ) { void AudioWidget::updateSlider( long i, long max ) { +this->setFocus(); time.setText( timeAsString( i ) + " / " + timeAsString( max ) ); @@ -358,6 +361,6 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { && y < imgButtonMask->height() && imgButtonMask->pixelIndex( x, y ) == i + 1 ); - if ( isOnButton && i == AudioVolumeUp ) - qDebug("on up"); +// if ( isOnButton && i == AudioVolumeUp ) +// qDebug("on up"); if ( isOnButton && !audioButtons[i].isHeld ) { @@ -366,9 +369,9 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { switch (i) { case AudioVolumeUp: - qDebug("more clicked"); + // qDebug("more clicked"); emit moreClicked(); return; case AudioVolumeDown: - qDebug("less clicked"); + // qDebug("less clicked"); emit lessClicked(); return; diff --git a/core/multimedia/opieplayer/loopcontrol.cpp b/core/multimedia/opieplayer/loopcontrol.cpp index 8cf0a75..82242a3 100644 --- a/core/multimedia/opieplayer/loopcontrol.cpp +++ b/core/multimedia/opieplayer/loopcontrol.cpp @@ -101,5 +101,5 @@ LoopControl::LoopControl( QObject *parent, const char *name ) isMuted = FALSE; connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( setMute(bool) ) ); -qDebug("starting loopcontrol"); + //qDebug("starting loopcontrol"); audioMutex = new Mutex; @@ -113,10 +113,10 @@ qDebug("starting loopcontrol"); pthread_attr_setschedparam(&audio_attr,¶ms); } else { - qDebug( "Error setting up a realtime thread, reverting to using a normal thread." ); + // qDebug( "Error setting up a realtime thread, reverting to using a normal thread." ); pthread_attr_destroy(&audio_attr); pthread_attr_init(&audio_attr); } #endif -qDebug("create audio thread"); + //qDebug("create audio thread"); pthread_create(&audio_tid, &audio_attr, (void * (*)(void *))startAudioThread, this); } @@ -228,6 +228,6 @@ void LoopControl::startAudio() { currentSample = audioSampleCounter + 1; - if ( currentSample != audioSampleCounter + 1 ) - qDebug("out of sync with decoder %i %i", currentSample, audioSampleCounter); +// if ( currentSample != audioSampleCounter + 1 ) +// qDebug("out of sync with decoder %i %i", currentSample, audioSampleCounter); long samplesRead = 0; @@ -242,5 +242,5 @@ void LoopControl::startAudio() { } else if ( sampleWaitTime <= -5000 ) { - qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); + // qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); // //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); currentSample = sampleWeShouldBeAt; @@ -362,5 +362,5 @@ bool LoopControl::init( const QString& filename ) { current_frame = total_video_frames = total_audio_samples = 0; - qDebug( "Using the %s decoder", mediaPlayerState->curDecoder()->pluginName() ); + // qDebug( "Using the %s decoder", mediaPlayerState->curDecoder()->pluginName() ); // ### Hack to use libmpeg3plugin to get the number of audio samples if we are using the libmad plugin @@ -388,5 +388,5 @@ bool LoopControl::init( const QString& filename ) { channels = mediaPlayerState->curDecoder()->audioChannels( astream ); - qDebug( "LC- channels = %d", channels ); + // qDebug( "LC- channels = %d", channels ); // if ( !total_audio_samples ) @@ -394,9 +394,9 @@ bool LoopControl::init( const QString& filename ) { total_audio_samples += 1000; - qDebug("total samples %d", total_audio_samples); + // qDebug("total samples %d", total_audio_samples); mediaPlayerState->setLength( total_audio_samples ); freq = mediaPlayerState->curDecoder()->audioFrequency( astream ); - qDebug( "LC- frequency = %d", freq ); + // qDebug( "LC- frequency = %d", freq ); audioSampleCounter = 0; @@ -404,5 +404,5 @@ bool LoopControl::init( const QString& filename ) { if ( mediaPlayerState->curDecoder()->pluginName() == QString("LibWavPlugin") ) { bits_per_sample =(int) mediaPlayerState->curDecoder()->getTime(); - qDebug("using stupid hack"); + // qDebug("using stupid hack"); } else { bits_per_sample=0; @@ -452,5 +452,5 @@ bool LoopControl::init( const QString& filename ) { void LoopControl::play() { - qDebug("LC- play"); + // qDebug("LC- play"); mediaPlayerState->setPosition( 0); //uglyhack diff --git a/core/multimedia/opieplayer/loopcontrol_threaded.cpp b/core/multimedia/opieplayer/loopcontrol_threaded.cpp index e99c97b..364e77b 100644 --- a/core/multimedia/opieplayer/loopcontrol_threaded.cpp +++ b/core/multimedia/opieplayer/loopcontrol_threaded.cpp @@ -193,5 +193,5 @@ void LoopControl::setPosition( long pos ) { videoMutex->lock(); audioMutex->lock(); -qDebug("setting position"); + //qDebug("setting position"); playtime.restart(); playtime = playtime.addMSecs( -pos * 1000 / framerate ); @@ -309,5 +309,5 @@ void LoopControl::startVideo() { videoMutex->lock(); if ( current_frame > prev_frame + 1 ) { - qDebug("skipped a frame"); + // qDebug("skipped a frame"); mediaPlayerState->curDecoder()->videoSetFrame( current_frame, stream ); } @@ -342,6 +342,6 @@ void LoopControl::startAudio() { currentSample = audioSampleCounter + 1; - if ( currentSample != audioSampleCounter + 1 ) - qDebug("out of sync with decoder %i %i", currentSample, audioSampleCounter); +// if ( currentSample != audioSampleCounter + 1 ) +// qDebug("out of sync with decoder %i %i", currentSample, audioSampleCounter); audioMutex->unlock(); @@ -372,5 +372,5 @@ void LoopControl::startAudio() { audioMutex->lock(); if ( sampleWaitTime <= -2000 ) { - qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); + // qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); currentSample = sampleWeShouldBeAt; @@ -403,5 +403,5 @@ void LoopControl::startAudio() { } - qDebug( "End of file" ); + // qDebug( "End of file" ); if ( !moreVideo && !moreAudio ) @@ -417,5 +417,5 @@ void LoopControl::killTimers() { void *thread_result = 0; if ( pthread_join(video_tid,&thread_result) != 0 ) - qDebug("thread join error 1"); + // qDebug("thread join error 1"); pthread_attr_destroy(&video_attr); } @@ -427,5 +427,5 @@ void LoopControl::killTimers() { void *thread_result = 0; if ( pthread_join(audio_tid,&thread_result) != 0 ) - qDebug("thread join error 2"); + // qDebug("thread join error 2"); pthread_attr_destroy(&audio_attr); } @@ -514,5 +514,5 @@ bool LoopControl::init( const QString& filename ) { current_frame = total_video_frames = total_audio_samples = 0; - qDebug( "Using the %s decoder", mediaPlayerState->curDecoder()->pluginName() ); + // qDebug( "Using the %s decoder", mediaPlayerState->curDecoder()->pluginName() ); // ### Hack to use libmpeg3plugin to get the number of audio samples if we are using the libmad plugin diff --git a/core/multimedia/opieplayer/mediaplayer.cpp b/core/multimedia/opieplayer/mediaplayer.cpp index 4f3823a..753b2e3 100644 --- a/core/multimedia/opieplayer/mediaplayer.cpp +++ b/core/multimedia/opieplayer/mediaplayer.cpp @@ -81,5 +81,5 @@ void MediaPlayer::play() { void MediaPlayer::setPlaying( bool play ) { - qDebug("MediaPlayer setPlaying"); + // qDebug("MediaPlayer setPlaying %d", play); if ( !play ) { mediaPlayerState->setPaused( FALSE ); @@ -92,5 +92,5 @@ void MediaPlayer::setPlaying( bool play ) { return; } - qDebug("about to ctrash"); + // qDebug("about to ctrash"); const DocLnk *playListCurrent = playList->current(); @@ -257,5 +257,5 @@ void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { break; case Key_F12: //home - qDebug("Blank here"); + // qDebug("Blank here"); break; case Key_F13: //mail diff --git a/core/multimedia/opieplayer/mediaplayerstate.cpp b/core/multimedia/opieplayer/mediaplayerstate.cpp index cf166d6..6823076 100644 --- a/core/multimedia/opieplayer/mediaplayerstate.cpp +++ b/core/multimedia/opieplayer/mediaplayerstate.cpp @@ -128,5 +128,5 @@ MediaPlayerDecoder *MediaPlayerState::libMpeg3Decoder() { void MediaPlayerState::loadPlugins() { - qDebug("load plugins"); + // qDebug("load plugins"); #ifndef QT_NO_COMPONENT QValueList<MediaPlayerPlugin>::Iterator mit; diff --git a/core/multimedia/opieplayer/om3u.cpp b/core/multimedia/opieplayer/om3u.cpp index 3541e5f..8b92a8c 100644 --- a/core/multimedia/opieplayer/om3u.cpp +++ b/core/multimedia/opieplayer/om3u.cpp @@ -71,5 +71,5 @@ void Om3u::readM3u() { while ( !t.atEnd() ) { s=t.readLine(); - qDebug(s); + // qDebug(s); if( s.find( "#", 0, TRUE) == -1 ) { if( s.left(2) == "E:" || s.left(2) == "P:" ) { @@ -136,5 +136,5 @@ void Om3u::write() { //writes list to m3u file if(count()>0) { for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { - qDebug(*it); + // qDebug(*it); list += *it+"\n"; } diff --git a/core/multimedia/opieplayer/playlistselection.cpp b/core/multimedia/opieplayer/playlistselection.cpp index 67187f8..94567f2 100644 --- a/core/multimedia/opieplayer/playlistselection.cpp +++ b/core/multimedia/opieplayer/playlistselection.cpp @@ -195,5 +195,5 @@ void PlayListSelection::writeCurrent( Config& cfg ) { if ( item ) cfg.writeEntry("current", item->text(0) ); - qDebug(item->text(0)); + // qDebug(item->text(0)); } diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 7ea95ab..1fc7dd8 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp @@ -308,5 +308,5 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) QWidget *LTab; LTab = new QWidget( tabWidget, "LTab" ); - playLists = new FileSelector( "playlist/plain", LTab, "fileselector" , FALSE, FALSE); //buggy + playLists = new FileSelector( "playlist/plain;audio/x-mpegurl", LTab, "fileselector" , FALSE, FALSE); QGridLayout *layoutL = new QGridLayout( LTab ); @@ -314,5 +314,4 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) layoutL->setMargin( 2); layoutL->addMultiCellWidget( playLists, 0, 0, 0, 1 ); -// playLists->setMinimumSize(233,260); tabWidget->insertTab(LTab,tr("Lists")); @@ -359,10 +358,10 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) Config cfg( "OpiePlayer" ); readConfig( cfg ); - QString currentPlaylist = cfg.readEntry("CurrentPlaylist","default"); - loadList(DocLnk( currentPlaylist)); - setCaption(tr("OpiePlayer: ")+ fullBaseName ( QFileInfo(currentPlaylist))); + + currentPlayList = cfg.readEntry("CurrentPlaylist","default"); + loadList(DocLnk( currentPlayList)); + setCaption(tr("OpiePlayer: ")+ fullBaseName ( QFileInfo(currentPlayList))); initializeStates(); - // audioUI->setFocus(); } @@ -422,13 +421,14 @@ void PlayListWidget::writeConfig( Config& cfg ) const { // the way writing lnks doesn't really check for out // of disk space, but check it anyway. - if ( !lnk->writeLink() ) { - QMessageBox::critical( 0, tr("Out of space"), - tr( "There was a problem saving " - "the playlist.\n" - "Your playlist " - "may be missing some entries\n" - "the next time you start it." ) - ); - } +// if ( !lnk->writeLink() ) { +// QMessageBox::critical( 0, tr("Out of space"), +// tr( "There was a problem saving " +// "the playlist.\n" +// "Your playlist " +// "may be missing some entries\n" +// "the next time you start it." ) +// ); +// } + } noOfFiles++; @@ -448,4 +448,5 @@ void PlayListWidget::addToSelection( const DocLnk& lnk ) { else mediaPlayerState->setPlaying( true); + } @@ -454,4 +455,9 @@ void PlayListWidget::clearList() { while ( first() ) d->selectedFiles->removeSelected(); + Config cfg( "OpiePlayer" ); + cfg.setGroup("PlayList"); + cfg.writeEntry("CurrentPlaylist",""); + currentPlayList=""; + } @@ -498,12 +504,11 @@ void PlayListWidget::setDocument(const QString& fileref) { fromSetDocument = true; d->setDocumentUsed = TRUE; - d->selectedFiles->setSelected(d->selectedFiles->firstChild(),true ); - mediaPlayerState->setPlaying( FALSE ); - qApp->processEvents(); - mediaPlayerState->setPlaying( TRUE ); + setDocumentEx(fileref); } void PlayListWidget::setDocumentEx(const QString& fileref) { - + qDebug("opieplayer receive "+fileref); + clearList(); + DocLnk lnk; QFileInfo fileInfo(fileref); if ( !fileInfo.exists() ) { @@ -512,5 +517,5 @@ void PlayListWidget::setDocumentEx(const QString& fileref) { return; } - qDebug("setDocument "+fileref); + // qDebug("<<<<<<<<<<<<<<<<<<<<<<setDocument "+fileref); QString extension = fileInfo.extension(false); if( extension.find( "m3u", 0, false) != -1) { //is m3u @@ -522,7 +527,7 @@ void PlayListWidget::setDocumentEx(const QString& fileref) { else if( fileref.find("playlist",0,TRUE) != -1) {//is playlist clearList(); - DocLnk lnk; lnk.setName( fileInfo.baseName() ); //sets name lnk.setFile( fileref ); //sets file name + lnk.setIcon("Sound"); //addToSelection( lnk ); @@ -530,23 +535,29 @@ void PlayListWidget::setDocumentEx(const QString& fileref) { d->selectedFiles->first(); } else { - clearList(); - DocLnk lnk; + if( fileref.find(".desktop",0,TRUE) != -1) { + lnk = DocLnk(fileref); + } else { lnk.setName( fileInfo.baseName() ); //sets name lnk.setFile( fileref ); //sets file name + lnk.setIcon("Sound"); + } + addToSelection( lnk ); // addToSelection( DocLnk( fileref ) ); + lnk.removeLinkFile(); + // qApp->processEvents(); + } + setCaption(tr("OpiePlayer")); d->setDocumentUsed = TRUE; + d->selectedFiles->setSelected(d->selectedFiles->firstChild(),true ); mediaPlayerState->setPlaying( FALSE ); qApp->processEvents(); mediaPlayerState->setPlaying( TRUE ); - // qApp->processEvents(); - setCaption(tr("OpiePlayer")); - } + } void PlayListWidget::setActiveWindow() { - qDebug("SETTING active window"); - + // qDebug("SETTING active window"); // When we get raised we need to ensure that it switches views char origView = mediaPlayerState->view(); @@ -562,24 +573,8 @@ void PlayListWidget::useSelectedDocument() { const DocLnk *PlayListWidget::current() { // this is fugly - -// if( fromSetDocument) { -// qDebug("from setDoc"); -// DocLnkSet files; -// Global::findDocuments(&files, "video/*;audio/*"); -// QListIterator<DocLnk> dit( files.children() ); -// for ( ; dit.current(); ++dit ) { -// if(dit.current()->linkFile() == setDocFileRef) { -// qDebug(setDocFileRef); -// return dit; -// } -// } -// } else - - qDebug("current"); - switch (tabWidget->currentPageIndex()) { case 0: //playlist { - qDebug("playlist"); + // qDebug("playlist"); if ( mediaPlayerState->playlist() ) { return d->selectedFiles->current(); @@ -594,9 +589,8 @@ const DocLnk *PlayListWidget::current() { // this is fugly case 1://audio { - qDebug("audioView"); + // qDebug("audioView"); QListIterator<DocLnk> dit( files.children() ); for ( ; dit.current(); ++dit ) { if( dit.current()->name() == audioView->currentItem()->text(0) && !insanityBool) { - qDebug("here"); insanityBool=TRUE; return dit; @@ -607,5 +601,4 @@ const DocLnk *PlayListWidget::current() { // this is fugly case 2: // video { - qDebug("videoView"); QListIterator<DocLnk> Vdit( vFiles.children() ); for ( ; Vdit.current(); ++Vdit ) { @@ -718,5 +711,4 @@ void PlayListWidget::setView( char view ) { void PlayListWidget::addSelected() { - qDebug("addSelected"); DocLnk lnk; QString filename; @@ -768,5 +760,4 @@ void PlayListWidget::playIt( QListViewItem *) { // d->setDocumentUsed = FALSE; // mediaPlayerState->curPosition =0; - qDebug("playIt"); // mediaPlayerState->setPlaying(FALSE); mediaPlayerState->setPlaying(TRUE); @@ -842,10 +833,8 @@ void PlayListWidget::tabChanged(QWidget *) { void PlayListWidget::btnPlay(bool b) { - qDebug("<<<<<<<<<<<<<<<BtnPlay %d", b); // mediaPlayerState->setPlaying(b); switch ( tabWidget->currentPageIndex()) { case 0: { - qDebug("1"); // if( d->selectedFiles->current()->file().find(" ",0,TRUE) != -1 // if( d->selectedFiles->current()->file().find("%20",0,TRUE) != -1) { @@ -860,5 +849,4 @@ void PlayListWidget::btnPlay(bool b) { case 1: { - qDebug("2"); // d->selectedFiles->unSelect(); addToSelection( audioView->currentItem() ); @@ -872,5 +860,4 @@ void PlayListWidget::btnPlay(bool b) { case 2: { - qDebug("3"); addToSelection( videoView->currentItem() ); @@ -923,5 +910,4 @@ void PlayListWidget::viewPressed( int mouse, QListViewItem *, const QPoint&, int void PlayListWidget::playSelected() { - qDebug("playSelected"); btnPlay( true); // d->selectedFiles->unSelect(); @@ -950,5 +936,5 @@ void PlayListWidget::listDelete() { Config cfg( "OpiePlayer" ); cfg.setGroup("PlayList"); - QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); + currentPlayList = cfg.readEntry("CurrentPlaylist",""); QString file; // int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); @@ -1074,5 +1060,4 @@ void PlayListWidget::populateVideoView() { void PlayListWidget::openFile() { - qDebug("<<<<<<<<<OPEN File"); QString filename, name; InputDialog *fileDlg; @@ -1081,6 +1066,5 @@ void PlayListWidget::openFile() { if( fileDlg->result() == 1 ) { filename = fileDlg->text(); - qDebug( "Selected filename is " + filename ); -// Om3u *m3uList; + // qDebug( "Selected filename is " + filename ); DocLnk lnk; Config cfg( "OpiePlayer" ); @@ -1092,5 +1076,4 @@ void PlayListWidget::openFile() { if(filename.find(":",8,TRUE) != -1) { //found a port -// m3uFile = filename.left( filename.find( ":",8,TRUE)); m3uFile = filename; if( m3uFile.right( 1 ).find( '/' ) == -1) { @@ -1098,13 +1081,5 @@ void PlayListWidget::openFile() { } filename = m3uFile; -// qDebug("1 "+m3uFile); -// } else if(filename.left(4) == "http"){ -// m3uFile=filename; -// m3uFile = m3uFile.right( m3uFile.length() - 7); -// qDebug("2 "+m3uFile); -// } else{ -// m3uFile=filename; -// qDebug("3 "+m3uFile); - } + = } lnk.setName( m3uFile ); //sets name lnk.setFile( filename ); //sets file name @@ -1122,4 +1097,5 @@ void PlayListWidget::openFile() { lnk.setFile( filename ); //sets file name d->selectedFiles->addToSelection( lnk); + lnk.removeLinkFile(); writeCurrentM3u(); } @@ -1135,5 +1111,5 @@ void PlayListWidget::openFile() { reads m3u and shows files/urls to playlist widget */ void PlayListWidget::readm3u( const QString &filename ) { - qDebug( "read m3u filename " + filename ); + // qDebug( "read m3u filename " + filename ); Om3u *m3uList; @@ -1192,5 +1168,5 @@ reads pls and adds files/urls to playlist */ void PlayListWidget::readPls( const QString &filename ) { - qDebug( "pls filename is " + filename ); + // qDebug( "pls filename is " + filename ); Om3u *m3uList; QString s, name; @@ -1235,18 +1211,18 @@ void PlayListWidget::readPls( const QString &filename ) { writes current playlist to current m3u file */ void PlayListWidget::writeCurrentM3u() { - qDebug("writing to current m3u"); + // qDebug("writing to current m3u"); Config cfg( "OpiePlayer" ); cfg.setGroup("PlayList"); - QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); + currentPlayList = cfg.readEntry("CurrentPlaylist",""); Om3u *m3uList; - m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate ); + m3uList = new Om3u( currentPlayList, IO_ReadWrite | IO_Truncate ); if( d->selectedFiles->first()) { do { - qDebug( "writeCurrentM3u " +d->selectedFiles->current()->file()); + // qDebug( "writeCurrentM3u " +d->selectedFiles->current()->file()); m3uList->add( d->selectedFiles->current()->file() ); } while ( d->selectedFiles->next() ); - qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" ); + // qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" ); m3uList->write(); m3uList->close(); @@ -1305,5 +1281,5 @@ void PlayListWidget::writem3u() { if(!lnk.writeLink()) { - qDebug("Writing doclink did not work"); + // qDebug("Writing doclink did not work"); } @@ -1335,5 +1311,4 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e) break; case Key_Q: //add to playlist - qDebug("Add"); addSelected(); break; @@ -1346,5 +1321,4 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e) // break; case Key_Space: - qDebug("Play"); // playSelected(); puh break; @@ -1399,5 +1373,5 @@ void PlayListWidget::keyPressEvent( QKeyEvent *) void PlayListWidget::doBlank() { - qDebug("do blanking"); + // qDebug("do blanking"); fd=open("/dev/fb0",O_RDWR); if (fd != -1) { @@ -1411,5 +1385,5 @@ void PlayListWidget::doUnblank() { // int fd; // fd=open("/dev/fb0",O_RDWR); - qDebug("do unblanking"); + // qDebug("do unblanking"); if (fd != -1) { ioctl(fd,FBIOBLANK,0); @@ -1462,5 +1436,5 @@ void PlayListWidget::skinsMenuActivated( int item ) { void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { - qDebug("qcop message "+msg ); + // qDebug("qcop message "+msg ); QDataStream stream ( data, IO_ReadOnly ); if ( msg == "play()" ) { //plays current selection @@ -1499,8 +1473,6 @@ void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { QString file; stream >> file; - } else if ( msg == "setDocument(QString)" ) { //loop or not loop QCopEnvelope h("QPE/Application/opieplayer", "raise()"); } - } diff --git a/core/multimedia/opieplayer/videowidget.cpp b/core/multimedia/opieplayer/videowidget.cpp index 48104ca..02c8568 100644 --- a/core/multimedia/opieplayer/videowidget.cpp +++ b/core/multimedia/opieplayer/videowidget.cpp @@ -87,5 +87,5 @@ VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : skinPath = "opieplayer2/skins/default"; - qDebug("skin path " + skinPath); + // qDebug("skin path " + skinPath); // QString skinPath = "opieplayer2/skins/" + skin; @@ -102,5 +102,5 @@ VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : QString filename = QString( QPEApplication::qpeDir() + "/pics/" + skinPath + "/skinV_mask_" + skinV_mask_file_names[i] + ".png" ); - qDebug("loading "+filename); + // qDebug("loading "+filename); masks[i] = new QBitmap( filename ); @@ -120,5 +120,5 @@ VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : } } - qDebug("finished loading first pics"); + // qDebug("finished loading first pics"); for ( int i = 0; i < 7; i++ ) { @@ -352,5 +352,5 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { case VideoPlay: { - qDebug("play"); + // qDebug("play"); if( !mediaPlayerState->playing()) { mediaPlayerState->setPlaying( true); @@ -360,10 +360,10 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { } if( mediaPlayerState->isPaused ) { - qDebug("isPaused"); + // qDebug("isPaused"); setToggleButton( i, FALSE ); mediaPlayerState->setPaused( FALSE ); return; } else if( !mediaPlayerState->isPaused ) { - qDebug("is not paused"); + // qDebug("is not paused"); setToggleButton( i, TRUE ); mediaPlayerState->setPaused( TRUE ); @@ -374,5 +374,5 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { } - case VideoStop: qDebug("stop"); mediaPlayerState->setPlaying( FALSE ); setToggleButton( i+1, true); setToggleButton( i, true ); return; + case VideoStop: mediaPlayerState->setPlaying( FALSE ); setToggleButton( i+1, true); setToggleButton( i, true ); return; case VideoNext: mediaPlayerState->setNext(); return; case VideoPrevious: mediaPlayerState->setPrev(); return; |