From 16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 Mon Sep 17 00:00:00 2001 From: mickeyl Date: Sun, 04 Apr 2004 13:54:40 +0000 Subject: convert to Opie Debugging Framework --- (limited to 'noncore/multimedia') diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 28a42eb..36def67 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -133,7 +133,7 @@ void AudioWidget::sliderReleased() { } void AudioWidget::setPosition( long i ) { - // qDebug("<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>"); + odebug << "<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>" << oendl; if( !slider.isHidden()) { slider.hide(); } @@ -199,7 +199,7 @@ void AudioWidget::setSeekable( bool isSeekable ) { // this stops the slider from being moved, thus // does not stop stream when it reaches the end slider.show(); - qDebug( " CONNECT SET POSTION " ); + odebug << " CONNECT SET POSTION " << oendl; connect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); connect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); @@ -271,7 +271,7 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e) { break; case Key_F9: //activity hide(); - // qDebug("Audio F9"); + // odebug << "Audio F9" << oendl; e->accept(); break; case Key_F10: //contacts diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index a42b8e5..5c24dbe 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp @@ -106,10 +106,10 @@ Lib::Lib( InitializationMode initMode, XineVideoWidget* widget ) void Lib::run() { - qDebug( "Lib::run() started" ); + odebug << "Lib::run() started" << oendl; initialize(); m_initialized = true; - qDebug( "Lib::run() finished" ); + odebug << "Lib::run() finished" << oendl; } void Lib::initialize() @@ -215,7 +215,7 @@ int Lib::play( const QString& fileName, int startPos, int start_time ) { void Lib::stop() { assert( m_initialized ); - qDebug("<<<<<<<< STOP IN LIB TRIGGERED >>>>>>>"); + odebug << "<<<<<<<< STOP IN LIB TRIGGERED >>>>>>>" << oendl; xine_stop( m_stream ); } @@ -327,9 +327,9 @@ void Lib::ensureInitialized() if ( m_initialized ) return; - qDebug( "waiting for initialization thread to finish" ); + odebug << "waiting for initialization thread to finish" << oendl; wait(); - qDebug( "initialization thread finished!" ); + odebug << "initialization thread finished!" << oendl; } void Lib::setWidget( XineVideoWidget *widget ) @@ -422,7 +422,7 @@ void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) { assert( m_initialized ); if ( !m_video ) { - qWarning("not showing video now"); + owarn << "not showing video now" << oendl; return; } diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index a236775..7e38fc7 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp @@ -152,7 +152,7 @@ void MediaPlayer::next() { mediaPlayerState.setList(); } } else { //if playing from file list, let's just stop - qDebug("<<<<<<<<<<<<<<<<>"); + odebug << "<< /dev/fb0 could not be opened >>" << oendl; } } @@ -325,11 +325,11 @@ void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { case Key_F11: //menu break; case Key_F12: //home - qDebug("Blank here"); + odebug << "Blank here" << oendl; // mediaPlayerState->toggleBlank(); break; case Key_F13: //mail - qDebug("Blank here"); + odebug << "Blank here" << oendl; // mediaPlayerState->toggleBlank(); break; } diff --git a/noncore/multimedia/opieplayer2/om3u.cpp b/noncore/multimedia/opieplayer2/om3u.cpp index 26d5e15..95dbab5 100644 --- a/noncore/multimedia/opieplayer2/om3u.cpp +++ b/noncore/multimedia/opieplayer2/om3u.cpp @@ -37,7 +37,7 @@ Om3u::Om3u( const QString &filePath, int mode) : QStringList (){ -qDebug("<<<<<<0) { for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { -// qDebug(*it); +// odebug << *it << oendl; t << *it << "\n"; } } @@ -130,7 +130,7 @@ void Om3u::remove(const QString &filePath) { //removes from m3u list if(count()>0) { for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { currentFile=*it; - // qDebug(*it); + // odebug << *it << oendl; if( filePath != currentFile) list += currentFile+"\n"; diff --git a/noncore/multimedia/opieplayer2/playlistselection.cpp b/noncore/multimedia/opieplayer2/playlistselection.cpp index 015896f..3499837 100644 --- a/noncore/multimedia/opieplayer2/playlistselection.cpp +++ b/noncore/multimedia/opieplayer2/playlistselection.cpp @@ -44,7 +44,7 @@ private: PlayListSelection::PlayListSelection( QWidget *parent, const char *name ) : QListView( parent, name ) { -// qDebug("starting playlistselector"); +// odebug << "starting playlistselector" << oendl; // #ifdef USE_PLAYLIST_BACKGROUND // setStaticBackground( TRUE ); // setBackgroundPixmap( Resource::loadPixmap( "opieplayer/background" ) ); @@ -65,7 +65,7 @@ PlayListSelection::~PlayListSelection() { // #ifdef USE_PLAYLIST_BACKGROUND void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) { -// qDebug("drawBackground"); +// odebug << "drawBackground" << oendl; p->fillRect( r, QBrush( white ) ); // QImage logo = Resource::loadImage( "launcher/opielogo" ); // if ( !logo.isNull() ) @@ -184,7 +184,7 @@ void PlayListSelection::writeCurrent( Config& cfg ) { QListViewItem *item = selectedItem(); if ( item ) cfg.writeEntry("current", item->text(0) ); - qDebug(item->text(0)); + odebug << item->text(0) << oendl; } @@ -193,9 +193,9 @@ void PlayListSelection::setSelectedItem(const QString &strk ) { unSelect(); QListViewItemIterator it( this ); for ( ; it.current(); ++it ) { -// qDebug( it.current()->text(0)); +// odebug << it.current()->text(0) << oendl; if( strk == it.current()->text(0)) { -// qDebug( "We have a match "+strk); +// odebug << "We have a match "+strk << oendl; setSelected( it.current(), TRUE); ensureItemVisible( it.current() ); return; diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 4460833..956d206 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp @@ -182,11 +182,11 @@ void PlayListWidget::writeDefaultPlaylist() { QString currentString = config.readEntry( "CurrentPlaylist", filename); if( currentString == filename) { Om3u *m3uList; - // qDebug("<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>"); + // odebug << "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>" << oendl; if( d->selectedFiles->first() ) { m3uList = new Om3u(filename, IO_ReadWrite | IO_Truncate); do { - // qDebug(d->selectedFiles->current()->file()); + // odebug << d->selectedFiles->current()->file() << oendl; m3uList->add( d->selectedFiles->current()->file() ); } while ( d->selectedFiles->next() ); @@ -325,7 +325,7 @@ void PlayListWidget::addAllVideoToList() { void PlayListWidget::setDocument( const QString& fileref ) { - // qDebug( "<<<<<<<>>>>>>>>> "+fileref ); + // odebug << "<<<<<<<>>>>>>>>> "+fileref << oendl; fromSetDocument = TRUE; QFileInfo fileInfo(fileref); @@ -401,7 +401,7 @@ bool PlayListWidget::prev() { bool PlayListWidget::next() { -//qDebug("<<<<<<<<<<<isShuffled() ) { return prev(); } else { @@ -612,7 +612,7 @@ void PlayListWidget::openURL() { fileDlg->exec(); if( fileDlg->result() == 1 ) { filename = fileDlg->text(); - qDebug( "Selected filename is " + filename ); + odebug << "Selected filename is " + filename << oendl; // Om3u *m3uList; DocLnk lnk; Config cfg( "OpiePlayer" ); @@ -688,7 +688,7 @@ void PlayListWidget::openFile() { if( !str.isEmpty() ) { - qDebug( "Selected filename is " + str ); + odebug << "Selected filename is " + str << oendl; filename = str; DocLnk lnk; @@ -706,7 +706,7 @@ void PlayListWidget::openFile() { void PlayListWidget::readListFromFile( const QString &filename ) { - qDebug( "read list filename " + filename ); + odebug << "read list filename " + filename << oendl; QFileInfo fi(filename); Om3u *m3uList; QString s, name; @@ -719,7 +719,7 @@ void PlayListWidget::readListFromFile( const QString &filename ) { DocLnk lnk; for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) { s = *it; - // qDebug(s); + // odebug << s << oendl; if(s.left(4)=="http") { lnk.setName( s ); //sets file name lnk.setIcon("opieplayer2/musicfile"); @@ -753,7 +753,7 @@ void PlayListWidget::readListFromFile( const QString &filename ) { // writes current playlist to current m3u file */ void PlayListWidget::writeCurrentM3u() { - qDebug("writing to current m3u"); + odebug << "writing to current m3u" << oendl; Config cfg( "OpiePlayer" ); cfg.setGroup("PlayList"); QString currentPlaylist = cfg.readEntry("CurrentPlaylist","default"); @@ -763,11 +763,11 @@ void PlayListWidget::readListFromFile( const QString &filename ) { if( d->selectedFiles->first()) { do { - // qDebug( "add writeCurrentM3u " +d->selectedFiles->current()->file()); + // odebug << "add writeCurrentM3u " +d->selectedFiles->current()->file() << oendl; m3uList->add( d->selectedFiles->current()->file() ); } while ( d->selectedFiles->next() ); - // qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" ); + // odebug << "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" << oendl; m3uList->write(); m3uList->close(); } @@ -812,7 +812,7 @@ void PlayListWidget::writem3u() { if( !str.isEmpty() ) { name = str; // name = fileDlg->text(); -// qDebug( filename ); +// odebug << filename << oendl; if( name.find("/",0,true) != -1) {// assume they specify a file path filename = name; name = name.right(name.length()- name.findRev("/",-1,true) - 1 ); @@ -830,7 +830,7 @@ void PlayListWidget::writem3u() { m3uList->add( d->selectedFiles->current()->file()); } while ( d->selectedFiles->next() ); - // qDebug( list ); + // odebug << list << oendl; m3uList->write(); m3uList->close(); delete m3uList; @@ -842,7 +842,7 @@ void PlayListWidget::writem3u() { lnk.setIcon("opieplayer2/playlist2"); lnk.setName( name); //sets file name - // qDebug(filename); + // odebug << filename << oendl; Config config( "OpiePlayer" ); config.setGroup( "PlayList" ); @@ -850,7 +850,7 @@ void PlayListWidget::writem3u() { currentPlayList=filename; if(!lnk.writeLink()) { - qDebug("Writing doclink did not work"); + odebug << "Writing doclink did not work" << oendl; } setCaption(tr("OpiePlayer: ") + name); @@ -884,7 +884,7 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) { removeSelected(); break; // case Key_P: //play - // qDebug("Play"); + // odebug << "Play" << oendl; // playSelected(); // break; case Key_Space: @@ -914,7 +914,7 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) { } void PlayListWidget::pmViewActivated(int index) { -// qDebug("%d", index); +// odebug << "" << index << "" << oendl; switch(index) { case -16: { @@ -944,7 +944,7 @@ void PlayListWidget::populateSkinsMenu() { QFileInfo *fi; while ( ( fi = it.current() ) ) { skinName = fi->fileName(); -// qDebug( fi->fileName() ); +// odebug << fi->fileName() << oendl; if( skinName != "." && skinName != ".." && skinName !="CVS" ) { item = skinsMenu->insertItem( fi->fileName() ) ; } @@ -1000,7 +1000,7 @@ QString PlayListWidget::currentFileListPathName() const { void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { - qDebug("qcop message "+msg ); + odebug << "qcop message "+msg << oendl; QDataStream stream ( data, IO_ReadOnly ); if ( msg == "play()" ) { //plays current selection btnPlay( true); diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp index 2ff190d..922f9d7 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp @@ -183,7 +183,7 @@ void PlayListWidgetGui::setView( char view ) { void PlayListWidgetGui::setActiveWindow() { - // qDebug("SETTING active window"); + // odebug << "SETTING active window" << oendl; // When we get raised we need to ensure that it switches views MediaPlayerState::DisplayType origDisplayType = mediaPlayerState->displayType(); mediaPlayerState->setDisplayType( MediaPlayerState::MediaSelection ); // invalidate diff --git a/noncore/multimedia/opieplayer2/skin.cpp b/noncore/multimedia/opieplayer2/skin.cpp index 7c38983..84f5f87 100644 --- a/noncore/multimedia/opieplayer2/skin.cpp +++ b/noncore/multimedia/opieplayer2/skin.cpp @@ -178,11 +178,11 @@ SkinData *SkinCache::lookupAndTake( const QString &skinPath, const QString &file if ( !data ) data = new SkinData; else - qDebug( "SkinCache: hit" ); + odebug << "SkinCache: hit" << oendl; QPixmap *bgPixmap = m_backgroundPixmapCache.find( skinPath ); if ( bgPixmap ) { - qDebug( "SkinCache: hit on bgpixmap" ); + odebug << "SkinCache: hit on bgpixmap" << oendl; data->backgroundPixmap = *bgPixmap; } else @@ -218,23 +218,23 @@ SkinLoader::IncrementalLoader::LoaderResult SkinLoader::IncrementalLoader::loadS { switch ( m_currentState ) { case LoadBackgroundPixmap: - qDebug( "load bgpixmap" ); + odebug << "load bgpixmap" << oendl; m_skin.backgroundPixmap(); m_currentState = LoadButtonUpImage; break; case LoadButtonUpImage: - qDebug( "load upimage" ); + odebug << "load upimage" << oendl; m_skin.buttonUpImage(); m_currentState = LoadButtonDownImage; break; case LoadButtonDownImage: - qDebug( "load downimage" ); + odebug << "load downimage" << oendl; m_skin.buttonDownImage(); m_currentState = LoadButtonMasks; m_currentButton = 0; break; case LoadButtonMasks: - qDebug( "load button masks %i", m_currentButton ); + odebug << "load button masks " << m_currentButton << "" << oendl; m_skin.buttonMaskImage( m_info.buttonInfo[ m_currentButton ].fileName ); m_currentButton++; @@ -243,7 +243,7 @@ SkinLoader::IncrementalLoader::LoaderResult SkinLoader::IncrementalLoader::loadS break; case LoadButtonMask: - qDebug( "load whole mask" ); + odebug << "load whole mask" << oendl; m_skin.buttonMask( m_info.buttonInfo, m_info.buttonCount ); return LoadingCompleted; } @@ -258,7 +258,7 @@ SkinLoader::SkinLoader() SkinLoader::~SkinLoader() { - qDebug( "SkinLoader::~SkinLoader()" ); + odebug << "SkinLoader::~SkinLoader()" << oendl; killTimers(); delete m_currentLoader; } @@ -277,7 +277,7 @@ void SkinLoader::start() { assert( m_timerId == -1 ); m_timerId = startTimer( 100 /* ms */ ); - qDebug( "SkinLoader::start() %d jobs", pendingSkins.count() ); + odebug << "SkinLoader::start() " << pendingSkins.count() << " jobs" << oendl; } void SkinLoader::timerEvent( QTimerEvent *ev ) @@ -290,7 +290,7 @@ void SkinLoader::timerEvent( QTimerEvent *ev ) if ( !m_currentLoader ) { if ( pendingSkins.isEmpty() ) { - qDebug( "all jobs done" ); + odebug << "all jobs done" << oendl; killTimer( m_timerId ); m_timerId = -1; // ### qt3: use deleteLater(); @@ -302,7 +302,7 @@ void SkinLoader::timerEvent( QTimerEvent *ev ) pendingSkins.remove( pendingSkins.begin() ); m_currentLoader = new IncrementalLoader( nfo ); - qDebug( "new loader %i jobs left", pendingSkins.count() ); + odebug << "new loader " << pendingSkins.count() << " jobs left" << oendl; } if ( m_currentLoader->loadStep() == IncrementalLoader::LoadingCompleted ) { @@ -310,7 +310,7 @@ void SkinLoader::timerEvent( QTimerEvent *ev ) m_currentLoader = 0; } - qDebug( "finished step" ); + odebug << "finished step" << oendl; } void SkinLoader::deleteMe() diff --git a/noncore/multimedia/opieplayer2/threadutil.cpp b/noncore/multimedia/opieplayer2/threadutil.cpp index fb951b4..d8b8abe 100644 --- a/noncore/multimedia/opieplayer2/threadutil.cpp +++ b/noncore/multimedia/opieplayer2/threadutil.cpp @@ -187,7 +187,7 @@ void Thread::start() AutoLock lock( d->guard ); if ( d->isRunning ) { - qDebug( "ThreadUtil::Thread::start() called for running thread." ); + odebug << "ThreadUtil::Thread::start() called for running thread." << oendl; return; } @@ -196,7 +196,7 @@ void Thread::start() pthread_attr_setscope( &attributes, PTHREAD_SCOPE_SYSTEM ); int err = pthread_create( &d->self, &attributes, start_thread, ( void* )d ); if ( err != 0 ) { - qDebug( "ThreadUtil::Thread::start() : can't create thread: %s", strerror( err ) ); + odebug << "ThreadUtil::Thread::start() : can't create thread: " << strerror( err ) << "" << oendl; pthread_attr_destroy( &attributes ); return; } @@ -284,7 +284,7 @@ void ChannelMessage::reply() { if ( !m_isCall ) { - qDebug( "ChannelMessage::reply() - can't reply oneway message!" ); + odebug << "ChannelMessage::reply() - can't reply oneway message!" << oendl; return; } diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 8f11b2e..94f99f8 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp @@ -93,7 +93,7 @@ void XineControl::play( const QString& fileName ) { hasAudioChannel = FALSE; m_fileName = fileName; - qDebug("<>>>"); + odebug << "<>>>" << oendl; if ( !libXine->play( fileName, 0, 0 ) ) { QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() ); @@ -106,12 +106,12 @@ void XineControl::play( const QString& fileName ) { MediaPlayerState::DisplayType displayType; if ( !libXine->hasVideo() ) { displayType = MediaPlayerState::Audio; - qDebug("HAS AUDIO"); + odebug << "HAS AUDIO" << oendl; libXine->setShowVideo( false ); hasAudioChannel = TRUE; } else { displayType = MediaPlayerState::Video; - qDebug("HAS VIDEO"); + odebug << "HAS VIDEO" << oendl; libXine->setShowVideo( true ); hasVideoChannel = TRUE; } @@ -243,7 +243,7 @@ QString XineControl::getErrorCode() { int errorCode = libXine->error(); - qDebug( QString("ERRORCODE: %1 ").arg(errorCode) ); + odebug << QString("ERRORCODE: %1 ").arg(errorCode) << oendl; if ( errorCode == 1 ) { return tr( "No input plugin found for this media type" ); diff --git a/noncore/multimedia/opierec/device.cpp b/noncore/multimedia/opierec/device.cpp index ce49e96..5319d97 100644 --- a/noncore/multimedia/opierec/device.cpp +++ b/noncore/multimedia/opierec/device.cpp @@ -2,20 +2,20 @@ #include "device.h" +/* OPIE */ +#include #include #include +using namespace Opie::Core; - +/* STD */ #include #include #include #include #include #include -#include -// #include -// #include -// #include +#include #include #include @@ -32,10 +32,10 @@ Device::Device( QObject * parent, const char * dsp, const char * mixr, bool reco devRate=-1; if( !record){ //playing - qDebug("setting up DSP for playing"); + odebug << "setting up DSP for playing" << oendl; flags = O_WRONLY; } else { //recording - qDebug("setting up DSP for recording"); + odebug << "setting up DSP for recording" << oendl; flags = O_RDWR; // flags = O_RDONLY; @@ -96,7 +96,7 @@ void Device::changedOutVolume(int vol) { cfg.setGroup("Volume"); cfg.writeEntry("VolumePercent", QString::number( vol )); QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false; - qWarning("changing output vol %d", vol); + owarn << "changing output vol " << vol << "" << oendl; } ::close(fd); } @@ -111,7 +111,7 @@ void Device::changedInVolume(int vol ) { cfg.setGroup("Volume"); cfg.writeEntry("Mic", QString::number(vol )); QCopEnvelope( "QPE/System", "micChange(bool)" ) << false; - qWarning("changing input volume %d", vol); + owarn << "changing input volume " << vol << "" << oendl; } ::close(fd); } @@ -149,22 +149,22 @@ exit(1); break; case 0: { */ -qDebug("Opening %s",dspstr); +odebug << "Opening " << dspstr << "" << oendl; if (( sd = ::open( dspstr, flags)) == -1) { perror("open(\"/dev/dsp\")"); QString errorMsg="Could not open audio device\n /dev/dsp\n" +(QString)strerror(errno); - qDebug("XXXXXXXXXXXXXXXXXXXXXXX "+errorMsg); + odebug << "XXXXXXXXXXXXXXXXXXXXXXX "+errorMsg << oendl; return -1; } -qDebug("Opening mixer"); +odebug << "Opening mixer" << oendl; int mixerHandle=0; if (( mixerHandle = open("/dev/mixer",O_RDWR))<0) { perror("open(\"/dev/mixer\")"); QString errorMsg="Could not open audio device\n /dev/dsp\n" +(QString)strerror(errno); - qDebug("XXXXXXXXXXXXXXXXXXXXXX "+errorMsg); + odebug << "XXXXXXXXXXXXXXXXXXXXXX "+errorMsg << oendl; } if(ioctl(sd,SNDCTL_DSP_RESET,0)<0){ @@ -180,7 +180,7 @@ qDebug("Opening mixer"); /* close(pipefd[0]); write(pipefd[1], message, sizeof(message)); close(pipefd[1]); - // qDebug("%d",soundDevice->sd ); + // odebug << "" << soundDevice->sd << "" << oendl; _exit(0); } default: @@ -206,13 +206,13 @@ qDebug("Opening mixer"); */ // bool ok; // sd = s.toInt(&ok, 10); -// qDebug("<<<<<<<<<<<<<>>>>>>>>>>>>"+s); +// odebug << "<<<<<<<<<<<<<>>>>>>>>>>>>"+s << oendl; // f2.close(); // } ::close(mixerHandle ); -// qDebug("open device %s", dspstr); -// qDebug("success! %d",sd); +// odebug << "open device " << dspstr << "" << oendl; +// odebug << "success! " << sd << "" << oendl; return sd; } @@ -230,12 +230,12 @@ bool Device::closeDevice( bool) { ::close( sd); //close sound device // sdfd=0; // sd=0; -// qDebug("closed dsp"); +// odebug << "closed dsp" << oendl; return true; } bool Device::setDeviceFormat( int form) { - qDebug("set device res %d %d", form, sd); + odebug << "set device res " << form << " " << sd << "" << oendl; if (ioctl( sd, SNDCTL_DSP_SETFMT, &form)==-1) { //set format perror("ioctl(\"SNDCTL_DSP_SETFMT\")"); return false; @@ -245,7 +245,7 @@ bool Device::setDeviceFormat( int form) { } bool Device::setDeviceChannels( int ch) { - qDebug("set channels %d %d", ch, sd); + odebug << "set channels " << ch << " " << sd << "" << oendl; if (ioctl( sd, SNDCTL_DSP_CHANNELS, &ch)==-1) { perror("ioctl(\"SNDCTL_DSP_CHANNELS\")"); return false; @@ -255,7 +255,7 @@ bool Device::setDeviceChannels( int ch) { } bool Device::setDeviceRate( int rate) { - qDebug("set rate %d %d", rate, sd); + odebug << "set rate " << rate << " " << sd << "" << oendl; if (ioctl( sd, SNDCTL_DSP_SPEED, &rate) == -1) { perror("ioctl(\"SNDCTL_DSP_SPEED\")"); return false; @@ -318,9 +318,9 @@ int Device::getDeviceFragSize() { int frag_size; if (ioctl( sd, SNDCTL_DSP_GETBLKSIZE, &frag_size) == -1) { - qDebug("no fragsize"); + odebug << "no fragsize" << oendl; } else { - qDebug("driver says frag size is %d", frag_size); + odebug << "driver says frag size is " << frag_size << "" << oendl; } return frag_size; } diff --git a/noncore/multimedia/opierec/helpwindow.cpp b/noncore/multimedia/opierec/helpwindow.cpp index 6aebaa1..7f984c3 100644 --- a/noncore/multimedia/opierec/helpwindow.cpp +++ b/noncore/multimedia/opierec/helpwindow.cpp @@ -9,14 +9,19 @@ *****************************************************************************/ #include "helpwindow.h" -#include -#include +/* OPIE */ +#include #include +using namespace Opie::Core; +/* QT */ +#include +#include #include #include +/* STD */ #include HelpWindow::HelpWindow( const QString& home_, const QString& _path, QWidget* parent, const char *name ) @@ -25,7 +30,7 @@ HelpWindow::HelpWindow( const QString& home_, const QString& _path, QWidget* par QGridLayout *layout = new QGridLayout( this ); layout->setSpacing( 2); layout->setMargin( 2); - qDebug(_path); + odebug << _path << oendl; browser = new QTextBrowser( this ); QStringList Strlist; Strlist.append( home_); diff --git a/noncore/multimedia/opierec/opierec.pro b/noncore/multimedia/opierec/opierec.pro index 7b08f0e..ea1bae3 100644 --- a/noncore/multimedia/opierec/opierec.pro +++ b/noncore/multimedia/opierec/opierec.pro @@ -1,6 +1,4 @@ -#CONFIG = qt warn_on pdaudio -CONFIG = qt warn_on opie -#CONFIG = qt warn_on quick-app +CONFIG = qt warn_on HEADERS = adpcm.h \ pixmaps.h \ helpwindow.h \ @@ -29,7 +27,7 @@ contains(CONFIG, pdaudio) { # DESTDIR=$(QPEDIR)/bin } -contains(CONFIG, opie) { +!contains(CONFIG, pdaudio) { INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include DESTDIR=$(OPIEDIR)/bin diff --git a/noncore/multimedia/opierec/qtrec.cpp b/noncore/multimedia/opierec/qtrec.cpp index 1c64ab1..2187d5a 100644 --- a/noncore/multimedia/opierec/qtrec.cpp +++ b/noncore/multimedia/opierec/qtrec.cpp @@ -8,24 +8,22 @@ #include "pixmaps.h" #include "qtrec.h" #include "waveform.h" - -#include - extern "C" { #include "adpcm.h" } -#include - +/* OPIE */ +#include #include #include #include #include #include +using namespace Opie::Core; +/* QT */ #include #include -//#include #include #include #include @@ -38,6 +36,7 @@ extern "C" { #include #include +/* STD */ #include #include #include @@ -53,7 +52,7 @@ extern "C" { #include #include #include - +#include #ifdef PDAUDIO //ALSA #include @@ -136,17 +135,17 @@ void quickRec() int level = 0; int threshold = 0; // int bits = filePara.resolution; -// qDebug("bits %d", bits); +// odebug << "bits " << bits << "" << oendl; if( filePara.resolution == 16 ) { //AFMT_S16_LE) -// qDebug("AFMT_S16_LE size %d", filePara.SecondsToRecord); -// qDebug("samples to record %d", filePara.samplesToRecord); -// qDebug("%d", filePara.sd); +// odebug << "AFMT_S16_LE size " << filePara.SecondsToRecord << "" << oendl; +// odebug << "samples to record " << filePara.samplesToRecord << "" << oendl; +// odebug << "" << filePara.sd << "" << oendl; level = 7; threshold = 0; if( filePara.format == WAVE_FORMAT_DVI_ADPCM) { -// qDebug("start recording WAVE_FORMAT_DVI_ADPCM"); +// odebug << "start recording WAVE_FORMAT_DVI_ADPCM" << oendl; // <<<<<<<<<<<<<<<<<<<<<<<<<<< WAVE_FORMAT_DVI_ADPCM >>>>>>>>>>>>>>>>>>>>>> char abuf[ BUFSIZE/2 ]; short sbuf[ BUFSIZE ]; @@ -157,7 +156,7 @@ void quickRec() for(;;) { if ( stopped) { -// qDebug("quickRec:: stopped"); +// odebug << "quickRec:: stopped" << oendl; break; } @@ -166,7 +165,7 @@ void quickRec() if(number <= 0) { perror("recording error "); - qDebug( "%s %d", filePara.fileName, number); + odebug << "" << filePara.fileName << " " << number << "" << oendl; stopped = true; return; } @@ -192,14 +191,14 @@ void quickRec() } } else { // <<<<<<<<<<<<<<<<<<<<<<<<<<< WAVE_FORMAT_PCM >>>>>>>>>>>>>>>>>>>>>> - qDebug("start recording WAVE_FORMAT_PCM"); + odebug << "start recording WAVE_FORMAT_PCM" << oendl; short inbuffer[ BUFSIZE ], outbuffer[ BUFSIZE ]; memset( inbuffer, 0, BUFSIZE); memset( outbuffer, 0, BUFSIZE); for(;;) { if ( stopped) { - qDebug("quickRec:: stopped"); + odebug << "quickRec:: stopped" << oendl; stopped = true; break; // stop if playing was set to false return; @@ -210,7 +209,7 @@ void quickRec() if( number <= 0) { perror( "recording error "); - qDebug( filePara.fileName); + odebug << filePara.fileName << oendl; stopped = true; return; } @@ -250,7 +249,7 @@ void quickRec() for(;;) { if ( stopped) { - qDebug("quickRec:: stopped"); + odebug << "quickRec:: stopped" << oendl; break; // stop if playing was set to false } @@ -373,7 +372,7 @@ void playIt() qApp->processEvents(); if( /*total >= filePara.numberSamples || */ bytesWritten == 0) { - qWarning("Jane! Stop this crazy thing!"); + owarn << "Jane! Stop this crazy thing!" << oendl; stopped = true; // playing = false; break; @@ -718,7 +717,7 @@ void QtRec::initIconView() { QPixmap image0( ( const char** ) image0_data ); int nFiles = cfg.readNumEntry("NumberofFiles",0); -// qDebug("init number of files %d", nFiles); +// odebug << "init number of files " << nFiles << "" << oendl; for(int i=1;i<= nFiles;i++) { @@ -860,7 +859,7 @@ void QtRec::initConfig() { } void QtRec::stop() { - qWarning("STOP"); + owarn << "STOP" << oendl; setRecordButton(false); if( !recording) @@ -922,20 +921,20 @@ bool QtRec::rec() { //record // soundDevice->getDeviceChannels()); //filePara.sampleRate = cfg.readNumEntry("samplerate", 22050); -// qDebug("sample rate is %d", filePara.sampleRate); +// odebug << "sample rate is " << filePara.sampleRate << "" << oendl; filePara.SecondsToRecord = getCurrentSizeLimit(); -// qDebug("size limit %d sec", filePara.SecondsToRecord); +// odebug << "size limit " << filePara.SecondsToRecord << " sec" << oendl; int diskSize = checkDiskSpace( (const QString &) wavFile->trackName()); if( filePara.SecondsToRecord == 0) { fileSize = diskSize; } else if( filePara.format == WAVE_FORMAT_PCM) { -// qDebug("WAVE_FORMAT_PCM"); +// odebug << "WAVE_FORMAT_PCM" << oendl; fileSize = (filePara.SecondsToRecord ) * filePara.channels * filePara.sampleRate * ( filePara.resolution / 8) + 1000; } else { -// qDebug("WAVE_FORMAT_DVI_ADPCM"); +// odebug << "WAVE_FORMAT_DVI_ADPCM" << oendl; fileSize = ((filePara.SecondsToRecord) * filePara.channels * filePara.sampleRate * ( filePara.resolution / 8) ) / 4 + 250; } @@ -947,7 +946,7 @@ bool QtRec::rec() { //record paused = false; } // else { - qDebug("Setting timeslider %d", filePara.samplesToRecord); + odebug << "Setting timeslider " << filePara.samplesToRecord << "" << oendl; // if(fileSize != 0) timeSlider->setRange(0, filePara.samplesToRecord); // } @@ -966,7 +965,7 @@ bool QtRec::rec() { //record setCaption( msg); #endif filePara.fileName=currentFile.latin1(); - qDebug("Start recording thread"); + odebug << "Start recording thread" << oendl; stopped = false; #ifdef THREADED @@ -1010,13 +1009,13 @@ void QtRec::thisTab(QWidget* widg) { void QtRec::getOutVol( ) { filePara.outVol = soundDevice->getOutVolume(); -// qDebug("out vol %d", filePara.outVol); +// odebug << "out vol " << filePara.outVol << "" << oendl; OutputSlider->setValue( -filePara.outVol); } void QtRec::getInVol() { filePara.inVol = soundDevice->getInVolume(); -// qDebug("in vol %d", filePara.inVol); +// odebug << "in vol " << filePara.inVol << "" << oendl; InputSlider->setValue( -filePara.inVol); } @@ -1090,11 +1089,11 @@ bool QtRec::setupAudio( bool b) { if( !compressionCheckBox->isChecked()) { filePara.format = WAVE_FORMAT_PCM; -// qDebug("WAVE_FORMAT_PCM"); +// odebug << "WAVE_FORMAT_PCM" << oendl; } else { filePara.format = WAVE_FORMAT_DVI_ADPCM; sampleformat = AFMT_S16_LE; -// qDebug("WAVE_FORMAT_DVI_ADPCM"); +// odebug << "WAVE_FORMAT_DVI_ADPCM" << oendl; } #endif @@ -1110,15 +1109,15 @@ bool QtRec::setupAudio( bool b) { } // if(soundDevice) delete soundDevice; - qDebug("<<<<<<<<<<<<<<<<<<changeSettings( filePara.sampleRate, filePara.channels ); soundDevice = new Device( this, dspString, mixerString, b); // soundDevice->openDsp(); soundDevice->reset(); - qDebug("device has been made %d", soundDevice->sd); + odebug << "device has been made " << soundDevice->sd << "" << oendl; ////////////////// <<<<<<<<<<<<>>>>>>>>>>>> soundDevice->setDeviceFormat( sampleformat); @@ -1149,7 +1148,7 @@ bool QtRec::setupAudio( bool b) { bool QtRec::setUpFile() { //setup file for recording -// qDebug("Setting up wavfile"); +// odebug << "Setting up wavfile" << oendl; // if(wavFile) delete wavFile; wavFile = new WavFile( this, (const QString &)"", true, @@ -1182,7 +1181,7 @@ bool QtRec::doPlay() { recording = false; QString num; - qDebug( "Play number of samples %d", filePara.numberSamples); + odebug << "Play number of samples " << filePara.numberSamples << "" << oendl; // timeSlider->setRange( 0, filePara.numberSamples); @@ -1234,7 +1233,7 @@ void QtRec::changesamplerateCombo(int i) { rate = sampleRateComboBox->text(i).toInt(&ok, 10); cfg.writeEntry( "samplerate",rate); filePara.sampleRate=rate; - qDebug( "Change sample rate %d", rate); + odebug << "Change sample rate " << rate << "" << oendl; cfg.write(); } @@ -1254,7 +1253,7 @@ void QtRec::changeDirCombo(int index) { const QString path = (*it)->path(); recDir = path; cfg.writeEntry("directory", recDir); - qDebug("new rec dir "+recDir); + odebug << "new rec dir "+recDir << oendl; } } cfg.write(); @@ -1374,7 +1373,7 @@ void QtRec::keyPressEvent( QKeyEvent *e) { // newSound(); break; case Key_Left: { - qDebug("rewinding"); + odebug << "rewinding" << oendl; if( !e->isAutoRepeat()) rewindPressed(); } @@ -1428,19 +1427,19 @@ void QtRec::keyReleaseEvent( QKeyEvent *e) { break; case Key_Up: // stop(); - qDebug("Up"); + odebug << "Up" << oendl; break; case Key_Down: // start(); - // qDebug("Down"); + // odebug << "Down" << oendl; // newSound(); break; case Key_Left: - qDebug("Left"); + odebug << "Left" << oendl; rewindReleased(); break; case Key_Right: - qDebug("Right"); + odebug << "Right" << oendl; FastforwardReleased(); break; } @@ -1475,11 +1474,11 @@ void QtRec::endRecording() { // move tmp file to regular file QString cmd; cmd.sprintf("mv "+ wavFile->trackName() + " " + wavFile->currentFileName); -// qDebug("moving tmp file to "+currentFileName); +// odebug << "moving tmp file to "+currentFileName << oendl; system( cmd.latin1()); } - qDebug("Just moved " + wavFile->currentFileName); + odebug << "Just moved " + wavFile->currentFileName << oendl; Config cfg("OpieRec"); cfg.setGroup("Sounds"); @@ -1495,10 +1494,10 @@ void QtRec::endRecording() { QString time; time.sprintf("%.2f", filePara.numberOfRecordedSeconds); cfg.writeEntry( wavFile->currentFileName, time ); -// qDebug("writing config numberOfRecordedSeconds "+time); +// odebug << "writing config numberOfRecordedSeconds "+time << oendl; cfg.write(); - qDebug("finished recording"); + odebug << "finished recording" << oendl; timeLabel->setText(""); } @@ -1516,7 +1515,7 @@ void QtRec::endPlaying() { stopped = true; waveform->reset(); // errorStop(); -// qDebug("end playing"); +// odebug << "end playing" << oendl; setRecordButton( false); toBeginningButton->setEnabled( true); @@ -1528,7 +1527,7 @@ void QtRec::endPlaying() { soundDevice->closeDevice( false); soundDevice->sd = -1; // if(soundDevice) delete soundDevice; -// qDebug("file and sound device closed"); +// odebug << "file and sound device closed" << oendl; timeLabel->setText(""); total = 0; filePara.numberSamples = 0; @@ -1537,9 +1536,9 @@ void QtRec::endPlaying() { filePara.fd = 0; // if(wavFile) delete wavFile; //this crashes -// qDebug("track closed"); +// odebug << "track closed" << oendl; killTimers(); - qWarning("reset slider"); + owarn << "reset slider" << oendl; timeSlider->setValue(0); if(soundDevice) delete soundDevice; @@ -1561,7 +1560,7 @@ bool QtRec::openPlayFile() { for(int i=0;isetPageStep(1); monitoring = true; - qDebug("file %d, samples %d %d", filePara.fd, filePara.numberSamples, filePara.sampleRate); + odebug << "file " << filePara.fd << ", samples " << filePara.numberSamples << " " << filePara.sampleRate << "" << oendl; int sec = (int) (( filePara.numberSamples / filePara.sampleRate) / filePara.channels) / ( filePara.channels*( filePara.resolution/8)); - qWarning("seconds %d", sec); + owarn << "seconds " << sec << "" << oendl; timeSlider->setRange(0, filePara.numberSamples ); } @@ -1690,7 +1689,7 @@ void QtRec::doRename() { } void QtRec::okRename() { - qDebug(renameBox->text()); + odebug << renameBox->text() << oendl; QString filename = renameBox->text(); cancelRename(); @@ -1702,7 +1701,7 @@ void QtRec::okRename() { QString file = ListView1->currentItem()->text(0); - qDebug("filename is " + filename); + odebug << "filename is " + filename << oendl; int nFiles = cfg.readNumEntry("NumberofFiles",0); @@ -1773,7 +1772,7 @@ void QtRec::doVolMuting(bool b) { } void QtRec::doMicMuting(bool b) { - // qDebug("mic mute"); + // odebug << "mic mute" << oendl; Config cfg( "qpe" ); cfg. setGroup( "Volume" ); cfg.writeEntry( "MicMute",b); @@ -1829,7 +1828,7 @@ long QtRec::checkDiskSpace(const QString &path) { // char f_fpack[6]; /* Pack name */ void QtRec::receive( const QCString &msg, const QByteArray & ) { - qDebug("Voicerecord received message "+msg); + odebug << "Voicerecord received message "+msg << oendl; } @@ -1854,7 +1853,7 @@ void QtRec::timerEvent( QTimerEvent * ) { stop(); } - qDebug( "%d", secCount ); + odebug << "" << secCount << "" << oendl; QString timeString; #ifdef DEV_VERSION QString msg; @@ -1870,7 +1869,7 @@ void QtRec::timerEvent( QTimerEvent * ) { void QtRec::changeTimeSlider(int index) { if( ListView1->currentItem() == 0 || !wavFile->track.isOpen()) return; - // qDebug("Slider moved to %d",index); + // odebug << "Slider moved to " << index << "" << oendl; paused = true; stopped = true; @@ -1885,7 +1884,7 @@ void QtRec::changeTimeSlider(int index) { void QtRec::timeSliderPressed() { if( ListView1->currentItem() == 0) return; - // qDebug("slider pressed"); + // odebug << "slider pressed" << oendl; paused = true; stopped = true; } @@ -1894,7 +1893,7 @@ void QtRec::timeSliderReleased() { if( ListView1->currentItem() == 0) return; sliderPos = timeSlider->value(); - // qDebug("slider released %d", sliderPos); + // odebug << "slider released " << sliderPos << "" << oendl; stopped = false; int newPos = lseek( filePara.fd, sliderPos, SEEK_SET); total = newPos*4; @@ -1924,7 +1923,7 @@ void QtRec::rewindTimerTimeout() { sliderValue = sliderValue - ( filePara.numberSamples / 100); // if(toBeginningButton->isDown()) timeSlider->setValue( sliderValue ) ; - // qDebug("%d", sliderValue); + // odebug << "" << sliderValue << "" << oendl; QString timeString; filePara.numberOfRecordedSeconds = (float)sliderValue / (float)filePara.sampleRate * (float)2; timeString.sprintf( "%.2f", filePara.numberOfRecordedSeconds); @@ -1938,7 +1937,7 @@ void QtRec::rewindReleased() { stopped = false; int newPos = lseek( filePara.fd, sliderPos, SEEK_SET); total = newPos * 4; - // qDebug("rewind released %d", total); + // odebug << "rewind released " << total << "" << oendl; startTimer( 1000); doPlay(); } @@ -2002,7 +2001,7 @@ QString QtRec::getStorage(const QString &fileName) { // const QString options = (*it)->options(); // if( name.find( tr("Internal"),0,true) == -1) { // storageComboBox->insertItem( name +" -> "+disk); - // qDebug(name); + // odebug << name << oendl; } return storage; // struct mntent *me; diff --git a/noncore/multimedia/opierec/wavFile.cpp b/noncore/multimedia/opierec/wavFile.cpp index 35bc14d..7e9b50f 100644 --- a/noncore/multimedia/opierec/wavFile.cpp +++ b/noncore/multimedia/opierec/wavFile.cpp @@ -2,17 +2,20 @@ #include "wavFile.h" #include "qtrec.h" +/* OPIE */ +#include +#include +using namespace Opie::Core; + +/* QT */ #include #include -#include - +/* STD */ #include - #include #include #include - #include #include #include @@ -24,7 +27,7 @@ WavFile::WavFile( QObject * parent,const QString &fileName, bool makeNwFile, int int channels, int resolution, int format ) : QObject( parent) { -//qDebug("new wave file"); +//odebug << "new wave file" << oendl; bool b = makeNwFile; wavSampleRate=sampleRate; wavFormat=format; @@ -40,7 +43,7 @@ WavFile::WavFile( QObject * parent,const QString &fileName, bool makeNwFile, int bool WavFile::newFile() { -// qDebug("Set up new file"); +// odebug << "Set up new file" << oendl; Config cfg("OpieRec"); cfg.setGroup("Settings"); @@ -60,7 +63,7 @@ bool WavFile::newFile() { currentFileName += date; currentFileName+=".wav"; -// qDebug("set up file for recording: "+currentFileName); +// odebug << "set up file for recording: "+currentFileName << oendl; char pointer[] = "/tmp/opierec-XXXXXX"; int fd = 0; @@ -75,7 +78,7 @@ bool WavFile::newFile() { return false; } -// qDebug("Opening tmp file %s",pointer); +// odebug << "Opening tmp file " << pointer << "" << oendl; track.setName( pointer); } else { //just use regular file.. no moving @@ -85,7 +88,7 @@ bool WavFile::newFile() { } if(!track.open( IO_ReadWrite | IO_Truncate)) { QString errorMsg=(QString)strerror(errno); - qDebug(errorMsg); + odebug << errorMsg << oendl; QMessageBox::message("Note", "Error opening file.\n" +errorMsg); return false; @@ -106,14 +109,14 @@ void WavFile::closeFile() { } int WavFile::openFile(const QString ¤tFileName) { -// qDebug("open play file "+currentFileName); +// odebug << "open play file "+currentFileName << oendl; closeFile(); track.setName(currentFileName); if(!track.open(IO_ReadOnly)) { QString errorMsg=(QString)strerror(errno); - qDebug("<<<<<<<<<<< "+errorMsg+currentFileName); + odebug << "<<<<<<<<<<< "+errorMsg+currentFileName << oendl; QMessageBox::message("Note", "Error opening file.\n" +errorMsg); return -1; } else { @@ -131,11 +134,11 @@ bool WavFile::setWavHeader(int fd, wavhdr *hdr) { if( wavFormat == WAVE_FORMAT_PCM) { (*hdr).fmtTag = 1; // PCM -// qDebug("set header WAVE_FORMAT_PCM"); +// odebug << "set header WAVE_FORMAT_PCM" << oendl; } else { (*hdr).fmtTag = WAVE_FORMAT_DVI_ADPCM; //intel ADPCM - // qDebug("set header WAVE_FORMAT_DVI_ADPCM"); + // odebug << "set header WAVE_FORMAT_DVI_ADPCM" << oendl; } // (*hdr).nChannels = 1;//filePara.channels;// ? 2 : 1*/; // channels @@ -160,12 +163,12 @@ bool WavFile::adjustHeaders(int fd, int total) { write( fd, &i, sizeof(i)); lseek( fd, 40, SEEK_SET); write( fd, &total, sizeof(total)); - qDebug("adjusting header %d", total); + odebug << "adjusting header " << total << "" << oendl; return true; } int WavFile::parseWavHeader(int fd) { - qDebug("Parsing wav header"); + odebug << "Parsing wav header" << oendl; char string[4]; int found; short fmt; @@ -173,39 +176,39 @@ int WavFile::parseWavHeader(int fd) { unsigned long samplerrate, longdata; if (read(fd, string, 4) < 4) { - qDebug(" Could not read from sound file.\n"); + odebug << " Could not read from sound file.\n" << oendl; return -1; } if (strncmp(string, "RIFF", 4)) { - qDebug(" not a valid WAV file.\n"); + odebug << " not a valid WAV file.\n" << oendl; return -1; } lseek(fd, 4, SEEK_CUR); if (read(fd, string, 4) < 4) { - qDebug("Could not read from sound file.\n"); + odebug << "Could not read from sound file.\n" << oendl; return -1; } if (strncmp(string, "WAVE", 4)) { - qDebug("not a valid WAV file.\n"); + odebug << "not a valid WAV file.\n" << oendl; return -1; } found = 0; while (!found) { if (read(fd, string, 4) < 4) { - qDebug("Could not read from sound file.\n"); + odebug << "Could not read from sound file.\n" << oendl; return -1; } if (strncmp(string, "fmt ", 4)) { if (read(fd, &longdata, 4) < 4) { - qDebug("Could not read from sound file.\n"); + odebug << "Could not read from sound file.\n" << oendl; return -1; } lseek(fd, longdata, SEEK_CUR); } else { lseek(fd, 4, SEEK_CUR); if (read(fd, &fmt, 2) < 2) { - qDebug("Could not read format chunk.\n"); + odebug << "Could not read format chunk.\n" << oendl; return -1; } if (fmt != WAVE_FORMAT_PCM && fmt != WAVE_FORMAT_DVI_ADPCM) { @@ -215,30 +218,30 @@ int WavFile::parseWavHeader(int fd) { } wavFormat = fmt; // compressionFormat=fmt; - qDebug("compressionFormat is %d", fmt); + odebug << "compressionFormat is " << fmt << "" << oendl; if (read(fd, &ch, 2) < 2) { - qDebug("Could not read format chunk.\n"); + odebug << "Could not read format chunk.\n" << oendl; return -1; } else { wavChannels = ch; - qDebug("File has %d channels", ch); + odebug << "File has " << ch << " channels" << oendl; } if (read(fd, &samplerrate, 4) < 4) { - qDebug("Could not read from format chunk.\n"); + odebug << "Could not read from format chunk.\n" << oendl; return -1; } else { wavSampleRate = samplerrate; // sampleRate = samplerrate; - qDebug("File has samplerate of %d",(int) samplerrate); + odebug << "File has samplerate of " << (int) samplerrate << "" << oendl; } lseek(fd, 6, SEEK_CUR); if (read(fd, &bitrate, 2) < 2) { - qDebug("Could not read format chunk.\n"); + odebug << "Could not read format chunk.\n" << oendl; return -1; } else { wavResolution=bitrate; // resolution = bitrate; - qDebug("File has bitrate of %d", bitrate); + odebug << "File has bitrate of " << bitrate << "" << oendl; } found++; } @@ -246,20 +249,20 @@ int WavFile::parseWavHeader(int fd) { found = 0; while (!found) { if (read(fd, string, 4) < 4) { - qDebug("Could not read from sound file.\n"); + odebug << "Could not read from sound file.\n" << oendl; return -1; } if (strncmp(string, "data", 4)) { if (read(fd, &longdata, 4)<4) { - qDebug("Could not read from sound file.\n"); + odebug << "Could not read from sound file.\n" << oendl; return -1; } lseek(fd, longdata, SEEK_CUR); } else { if (read(fd, &longdata, 4) < 4) { - qDebug("Could not read from sound file.\n"); + odebug << "Could not read from sound file.\n" << oendl; return -1; } else { wavNumberSamples = longdata; diff --git a/noncore/multimedia/opierec/waveform.cpp b/noncore/multimedia/opierec/waveform.cpp index 9cc40b4..7c9a25f 100644 --- a/noncore/multimedia/opierec/waveform.cpp +++ b/noncore/multimedia/opierec/waveform.cpp @@ -19,8 +19,12 @@ **********************************************************************/ #include "waveform.h" -#include +/* OPIE */ +#include +using namespace Opie::Core; +/* QT */ +#include Waveform::Waveform( QWidget *parent, const char *name, WFlags fl ) : QWidget( parent, name, fl ) @@ -38,9 +42,9 @@ Waveform::Waveform( QWidget *parent, const char *name, WFlags fl ) void Waveform::changeSettings( int frequency, int channels ) { makePixmap(); -// qWarning("change waveform %d, %d", frequency, channels); +// owarn << "change waveform " << frequency << ", " << channels << "" << oendl; samplesPerPixel = frequency * channels / (5 * windowSize); - qWarning("Waveform::changeSettings %d", samplesPerPixel); + owarn << "Waveform::changeSettings " << samplesPerPixel << "" << oendl; if ( !samplesPerPixel ) samplesPerPixel = 1; currentValue = 0; @@ -96,7 +100,7 @@ void Waveform::newSamples( const short *buf, int len ) } // Copy the final state back to the object. -//qWarning("%d, %d, %d", currentValue, numSamples, windowPosn); +//owarn << "" << currentValue << ", " << numSamples << ", " << windowPosn << "" << oendl; this->currentValue = currentValue; this->numSamples = numSamples; this->windowPosn = windowPosn; diff --git a/noncore/multimedia/powerchord/config.in b/noncore/multimedia/powerchord/config.in index ab1512b..5db784a 100644 --- a/noncore/multimedia/powerchord/config.in +++ b/noncore/multimedia/powerchord/config.in @@ -1,7 +1,7 @@ config POWERCHORD boolean "opie-powerchord (guitar chord generator and tuning)" default "n" - depends ( LIBQPE || LIBQPE-X11 ) - comment "opie-powerchord needs a libqpe" - depends !(( LIBQPE || LIBQPE-X11 ) ) + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE + comment "opie-powerchord needs a libqpe and libopiecore2" + depends !(( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE ) diff --git a/noncore/multimedia/powerchord/powerchord.pro b/noncore/multimedia/powerchord/powerchord.pro index 917c88f..f7af6d6 100644 --- a/noncore/multimedia/powerchord/powerchord.pro +++ b/noncore/multimedia/powerchord/powerchord.pro @@ -18,8 +18,7 @@ SOURCES = main.cpp \ INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -#INTERFACES = powerchordbase.ui +LIBS += -lqpe -lopiecore2 DESTDIR = $(OPIEDIR)/bin TARGET = powerchord diff --git a/noncore/multimedia/powerchord/powerchordbase.cpp b/noncore/multimedia/powerchord/powerchordbase.cpp index 4fb5dda..0694ba3 100644 --- a/noncore/multimedia/powerchord/powerchordbase.cpp +++ b/noncore/multimedia/powerchord/powerchordbase.cpp @@ -7,9 +7,15 @@ ** WARNING! All changes made in this file will be lost! ****************************************************************************/ #include "powerchordbase.h" - #include "fretboard.h" #include "vumeter.h" + +/* OPIE */ +#include +#include +using namespace Opie::Core; + +/* QT */ #include #include #include @@ -18,8 +24,6 @@ #include #include #include -#include - /* * Constructs a PowerchordBase which is a child of 'parent', with the @@ -580,6 +584,6 @@ PowerchordBase::~PowerchordBase() void PowerchordBase::change_handler() { - qWarning( "PowerchordBase::change_handler(): Not implemented yet!" ); + owarn << "PowerchordBase::change_handler(): Not implemented yet!" << oendl; } diff --git a/noncore/multimedia/showimg/ImageFileSelector.cpp b/noncore/multimedia/showimg/ImageFileSelector.cpp index 79ee925..53cc883 100644 --- a/noncore/multimedia/showimg/ImageFileSelector.cpp +++ b/noncore/multimedia/showimg/ImageFileSelector.cpp @@ -1,14 +1,16 @@ +#include "ImageFileSelector.h" +/* OPIE */ +#include +#include +using namespace Opie::Core; -#include "qpe/qpeapplication.h" - -#include - -#include +/* QT */ +#include #include -#include "ImageFileSelector.h" - +/* STD */ +#include ThumbWidget::ThumbWidget(QPixmap p,QString text,const DocLnk& f,QWidget *parent,int w) : QWidget( parent ),fl(f) @@ -155,7 +157,7 @@ void ImageFileSelector::updateSizes() void ImageFileSelector::reread(bool) { -// qDebug("reread"); +// odebug << "reread" << oendl; ImageFileSelectorItem *item = (ImageFileSelectorItem *)detailed->selectedItem(); QString oldFile; if ( item ) @@ -221,7 +223,7 @@ int ImageFileSelector::fileCount() } const DocLnk * ImageFileSelector::selected() { - qDebug("image selected"); + odebug << "image selected" << oendl; ImageFileSelectorItem *item = (ImageFileSelectorItem *) detailed->selectedItem(); if ( item ) return new DocLnk( item->file() ); diff --git a/noncore/multimedia/showimg/showimg.cpp b/noncore/multimedia/showimg/showimg.cpp index 696a57b..24377ed 100644 --- a/noncore/multimedia/showimg/showimg.cpp +++ b/noncore/multimedia/showimg/showimg.cpp @@ -26,23 +26,25 @@ #include "ImageFileSelector.h" #include "settingsdialog.h" - +/* OPIE */ +#include #include - #include #include #include -#include +using namespace Opie::Core; +using namespace Opie::Ui; +/* QT */ +#include #include #include #include #include +/* STD */ #include - -using namespace Opie::Ui; ControlsDialog::ControlsDialog(const QString &caption,QImage image,int *brightness,QWidget *parent) : QDialog(parent,0,true) { @@ -286,7 +288,7 @@ ImageViewer::ImageViewer( QWidget *parent, const char *name, int /*wFlags*/ ) else cv=ImageFileSelector::DETAILED; - qDebug("cv = %d",cv); + odebug << "cv = " << cv << "" << oendl; fileSelector = new ImageFileSelector( cv,stack, "fs"); @@ -413,7 +415,7 @@ void ImageViewer::settings() dlg.setFastLoad(fastLoad); if ( QPEApplication::execDialog(&dlg) == QDialog::Accepted ) { - qDebug("<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>"); + odebug << "<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>" << oendl; slideDelay = dlg.delay(); slideRepeat = dlg.repeat(); slideReverse = dlg.reverse(); @@ -505,7 +507,7 @@ void ImageViewer::show() void ImageViewer::show(const QString& fileref) { -// qDebug("Show "+fileref); +// odebug << "Show "+fileref << oendl; bFromDocView = TRUE; closeFileSelector(); DocLnk link(fileref); @@ -535,7 +537,7 @@ void ImageViewer::openFile( const DocLnk &link ) { closeFileSelector(); // DocLnk link(file); - qDebug("open "+link.name()); + odebug << "open "+link.name() << oendl; updateCaption( link.name() ); loadImage( link.file() ); if (slideTimer->isActive()) { diff --git a/noncore/multimedia/showimg/showimg.pro b/noncore/multimedia/showimg/showimg.pro index 6fd019e..c905da8 100644 --- a/noncore/multimedia/showimg/showimg.pro +++ b/noncore/multimedia/showimg/showimg.pro @@ -1,4 +1,4 @@ -CONFIG += qt warn_on quick-app +CONFIG += qt warn_on quick-app HEADERS = showimg.h ImageFileSelector.h settingsdialog.h settingsdialogbase.h SOURCES = main.cpp showimg.cpp ImageFileSelector.cpp settingsdialog.cpp settingsdialogbase.cpp TARGET = showimg diff --git a/noncore/multimedia/tonleiter/config.in b/noncore/multimedia/tonleiter/config.in index d580ad7..9bd167e 100644 --- a/noncore/multimedia/tonleiter/config.in +++ b/noncore/multimedia/tonleiter/config.in @@ -1,4 +1,4 @@ config TONLEITER boolean "tonleiter (shows scales on sting instruments)" default "n" - depends ( LIBQPE || LIBQPE-X11 ) + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE diff --git a/noncore/multimedia/tonleiter/editinst.cpp b/noncore/multimedia/tonleiter/editinst.cpp index ccb4560..a8c20c8 100644 --- a/noncore/multimedia/tonleiter/editinst.cpp +++ b/noncore/multimedia/tonleiter/editinst.cpp @@ -1,8 +1,13 @@ #include "editinst.h" -#include - +/* OPIE */ +#include +#include #include +using namespace Opie::Core; + +/* QT */ +#include Menu::InstEditDialog::InstEditDialog(TonleiterData* data,QWidget* parent,const char* name) :QDialog(parent,name,true,0),data(data) @@ -100,7 +105,7 @@ void Menu::InstEditDialog::loadInstrument() { stringlist.clear(); Instrument inst=data->getInstrument(instid); - qDebug("load Instrument : %d strings",inst.noOfStrings()); + odebug << "load Instrument : " << inst.noOfStrings() << " strings" << oendl; for(uint s=0;s +using namespace Opie::Core; + +/* QT */ #include Graph::FretBoard::FretBoard(TonleiterData* data,QWidget* parent,const char* name,WFlags f) @@ -27,7 +32,7 @@ void Graph::FretBoard::paintEvent(QPaintEvent* pe) int instid=data->getCurrentInstrumentID(); inst=data->getInstrument(instid); - //qDebug("inst %d is %s",instid,inst.instName().data()); + //odebug << "inst " << instid << " is " << inst.instName().data() << "" << oendl; QRect mysize=rect(); @@ -143,17 +148,17 @@ void Graph::FretBoard::paintScale(QPainter* p) //no more than six octaves can be visualised (there is a zero octave) int octave=Note::octaveOfBaseNote(data->getCurrentBaseNote(),note)-baseoctave; if(octave<0) - qDebug("%d,%d",octave,baseoctave); + odebug << "" << octave << "," << baseoctave << "" << oendl; if(octave>5) { - qDebug("octave out of range"); + odebug << "octave out of range" << oendl; octave=5; } p->setPen(QColor(255,0,0)); int c= ( (note-12*baseoctave) - (12*octave+data->getCurrentBaseNote()) )*15; if(c<0 || c>255) - qDebug("%d = %d - ( %d + %d)",c,note,12*octave,data->getCurrentBaseNote()); + odebug << "" << c << " = " << note << " - ( " << 12*octave << " + " << data->getCurrentBaseNote() << ")" << oendl; QColor dotcolor(255,255,255); if(octave==0) diff --git a/noncore/multimedia/tonleiter/tonleiter.pro b/noncore/multimedia/tonleiter/tonleiter.pro index 4bd1bc2..4be3bef 100644 --- a/noncore/multimedia/tonleiter/tonleiter.pro +++ b/noncore/multimedia/tonleiter/tonleiter.pro @@ -1,13 +1,11 @@ TEMPLATE = app -#CONFIG = qt warn_on CONFIG = qt warn_on HEADERS = mainwidget.h tonleiterdata.h tonleiterdatahelper.h fretboard.h menuwidget.h editinst.h editstringwidget.h editscale.h pianoscale.h SOURCES = mainwidget.cpp tonleiterdata.cpp tonleiterdatahelper.cpp fretboard.cpp menuwidget.cpp main.cpp editinst.cpp editstringwidget.cpp editscale.cpp pianoscale.cpp INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -INTERFACES = +LIBS += -lqpe -lopiecore2 TARGET = tonleiter DESTDIR = $(OPIEDIR)/bin -#TMAKE_CXXFLAGS += -DQT_QWS_VERCEL_IDR -DQWS -fno-exceptions -fno-rtti + include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/multimedia/tonleiter/tonleiterdata.cpp b/noncore/multimedia/tonleiter/tonleiterdata.cpp index 33b3c49..564b7f0 100644 --- a/noncore/multimedia/tonleiter/tonleiterdata.cpp +++ b/noncore/multimedia/tonleiter/tonleiterdata.cpp @@ -1,9 +1,10 @@ #include "tonleiterdata.h" - -#include - using namespace Data; +/* OPIE */ +#include +#include +using namespace Opie::Core; TonleiterData::TonleiterData(QObject* parent) :QObject(parent) @@ -152,7 +153,7 @@ Instrument TonleiterData::getInstrument(int id) return instruments[id]; else { - qDebug("undefined insrtument %d of %d",id,instruments.count()); + odebug << "undefined insrtument " << id << " of " << instruments.count() << "" << oendl; return Instrument(); } @@ -174,7 +175,7 @@ Scale TonleiterData::getScale(int id) return scales[id]; else { - qDebug("Undefined scale"); + odebug << "Undefined scale" << oendl; return Scale(); } } diff --git a/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp b/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp index d904a71..285d2c1 100644 --- a/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp +++ b/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp @@ -34,7 +34,7 @@ int Note::octaveOfBaseNote(int base,int note) { int normnote = (note>=base) ? note-base : (12-base)+note; int octave=getOctaveOfNote(normnote); - //qDebug("note %d of %d base is norm %d -> ocatve %d",note,base,normnote,octave); + //odebug << "note " << note << " of " << base << " base is norm " << normnote << " -> ocatve " << octave << "" << oendl; return octave; } //**************************************************************************** @@ -131,12 +131,12 @@ bool Scale::noteInScale(int base,int note) if(halftones.contains(normnote)>0) { - //qDebug("OK : base : %d, note %d -> norm %d",base,note,normnote); + //odebug << "OK : base : " << base << ", note " << note << " -> norm " << normnote << "" << oendl; return true; } else { - //qDebug("BAD : base : %d, note %d -> norm %d",base,note,normnote); + //odebug << "BAD : base : " << base << ", note " << note << " -> norm " << normnote << "" << oendl; return false; } } -- cgit v0.9.0.2