28 files changed, 271 insertions, 246 deletions
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 | |||
@@ -132,9 +132,9 @@ void AudioWidget::sliderReleased() { | |||
132 | mediaPlayerState.setPosition( val ); | 132 | mediaPlayerState.setPosition( val ); |
133 | } | 133 | } |
134 | 134 | ||
135 | void AudioWidget::setPosition( long i ) { | 135 | void AudioWidget::setPosition( long i ) { |
136 | // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<set position %d",i); | 136 | // odebug << "<<<<<<<<<<<<<<<<<<<<<<<<set position " << i << "" << oendl; |
137 | updateSlider( i, mediaPlayerState.length() ); | 137 | updateSlider( i, mediaPlayerState.length() ); |
138 | } | 138 | } |
139 | 139 | ||
140 | 140 | ||
@@ -186,9 +186,9 @@ void AudioWidget::loadSkin() | |||
186 | 186 | ||
187 | void AudioWidget::setSeekable( bool isSeekable ) { | 187 | void AudioWidget::setSeekable( bool isSeekable ) { |
188 | 188 | ||
189 | if ( !isSeekable ) { | 189 | if ( !isSeekable ) { |
190 | qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>"); | 190 | odebug << "<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>" << oendl; |
191 | if( !slider.isHidden()) { | 191 | if( !slider.isHidden()) { |
192 | slider.hide(); | 192 | slider.hide(); |
193 | } | 193 | } |
194 | disconnect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 194 | disconnect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
@@ -198,9 +198,9 @@ void AudioWidget::setSeekable( bool isSeekable ) { | |||
198 | } else { | 198 | } else { |
199 | // this stops the slider from being moved, thus | 199 | // this stops the slider from being moved, thus |
200 | // does not stop stream when it reaches the end | 200 | // does not stop stream when it reaches the end |
201 | slider.show(); | 201 | slider.show(); |
202 | qDebug( " CONNECT SET POSTION " ); | 202 | odebug << " CONNECT SET POSTION " << oendl; |
203 | connect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 203 | connect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
204 | connect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 204 | connect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |
205 | connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | 205 | connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); |
206 | connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | 206 | connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); |
@@ -270,9 +270,9 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e) { | |||
270 | case Key_Home: | 270 | case Key_Home: |
271 | break; | 271 | break; |
272 | case Key_F9: //activity | 272 | case Key_F9: //activity |
273 | hide(); | 273 | hide(); |
274 | // qDebug("Audio F9"); | 274 | // odebug << "Audio F9" << oendl; |
275 | e->accept(); | 275 | e->accept(); |
276 | break; | 276 | break; |
277 | case Key_F10: //contacts | 277 | case Key_F10: //contacts |
278 | break; | 278 | break; |
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 | |||
@@ -105,12 +105,12 @@ Lib::Lib( InitializationMode initMode, XineVideoWidget* widget ) | |||
105 | } | 105 | } |
106 | 106 | ||
107 | void Lib::run() | 107 | void Lib::run() |
108 | { | 108 | { |
109 | qDebug( "Lib::run() started" ); | 109 | odebug << "Lib::run() started" << oendl; |
110 | initialize(); | 110 | initialize(); |
111 | m_initialized = true; | 111 | m_initialized = true; |
112 | qDebug( "Lib::run() finished" ); | 112 | odebug << "Lib::run() finished" << oendl; |
113 | } | 113 | } |
114 | 114 | ||
115 | void Lib::initialize() | 115 | void Lib::initialize() |
116 | { | 116 | { |
@@ -214,9 +214,9 @@ int Lib::play( const QString& fileName, int startPos, int start_time ) { | |||
214 | 214 | ||
215 | void Lib::stop() { | 215 | void Lib::stop() { |
216 | assert( m_initialized ); | 216 | assert( m_initialized ); |
217 | 217 | ||
218 | qDebug("<<<<<<<< STOP IN LIB TRIGGERED >>>>>>>"); | 218 | odebug << "<<<<<<<< STOP IN LIB TRIGGERED >>>>>>>" << oendl; |
219 | xine_stop( m_stream ); | 219 | xine_stop( m_stream ); |
220 | } | 220 | } |
221 | 221 | ||
222 | void Lib::pause( bool toggle ) { | 222 | void Lib::pause( bool toggle ) { |
@@ -326,11 +326,11 @@ void Lib::ensureInitialized() | |||
326 | { | 326 | { |
327 | if ( m_initialized ) | 327 | if ( m_initialized ) |
328 | return; | 328 | return; |
329 | 329 | ||
330 | qDebug( "waiting for initialization thread to finish" ); | 330 | odebug << "waiting for initialization thread to finish" << oendl; |
331 | wait(); | 331 | wait(); |
332 | qDebug( "initialization thread finished!" ); | 332 | odebug << "initialization thread finished!" << oendl; |
333 | } | 333 | } |
334 | 334 | ||
335 | void Lib::setWidget( XineVideoWidget *widget ) | 335 | void Lib::setWidget( XineVideoWidget *widget ) |
336 | { | 336 | { |
@@ -421,9 +421,9 @@ void Lib::xine_display_frame( void* user_data, uint8_t *frame, | |||
421 | void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) { | 421 | void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) { |
422 | assert( m_initialized ); | 422 | assert( m_initialized ); |
423 | 423 | ||
424 | if ( !m_video ) { | 424 | if ( !m_video ) { |
425 | qWarning("not showing video now"); | 425 | owarn << "not showing video now" << oendl; |
426 | return; | 426 | return; |
427 | } | 427 | } |
428 | 428 | ||
429 | assert( m_wid ); | 429 | assert( m_wid ); |
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 | |||
@@ -151,9 +151,9 @@ void MediaPlayer::next() { | |||
151 | } else { | 151 | } else { |
152 | mediaPlayerState.setList(); | 152 | mediaPlayerState.setList(); |
153 | } | 153 | } |
154 | } else { //if playing from file list, let's just stop | 154 | } else { //if playing from file list, let's just stop |
155 | qDebug("<<<<<<<<<<<<<<<<<stop for filelists"); | 155 | odebug << "<<<<<<<<<<<<<<<<<stop for filelists" << oendl; |
156 | mediaPlayerState.setPlaying(false); | 156 | mediaPlayerState.setPlaying(false); |
157 | mediaPlayerState.setDisplayType( MediaPlayerState::MediaSelection ); | 157 | mediaPlayerState.setDisplayType( MediaPlayerState::MediaSelection ); |
158 | if(l) mediaPlayerState.setLooping(l); | 158 | if(l) mediaPlayerState.setLooping(l); |
159 | if(r) mediaPlayerState.setShuffled(r); | 159 | if(r) mediaPlayerState.setShuffled(r); |
@@ -284,9 +284,9 @@ void MediaPlayer::blank( bool b ) { | |||
284 | fl= open( "/dev/fl", O_RDWR ); | 284 | fl= open( "/dev/fl", O_RDWR ); |
285 | #endif | 285 | #endif |
286 | if (fd != -1) { | 286 | if (fd != -1) { |
287 | if ( b ) { | 287 | if ( b ) { |
288 | qDebug("do blanking"); | 288 | odebug << "do blanking" << oendl; |
289 | #ifdef QT_QWS_SL5XXX | 289 | #ifdef QT_QWS_SL5XXX |
290 | ioctl( fd, FBIOBLANK, 1 ); | 290 | ioctl( fd, FBIOBLANK, 1 ); |
291 | if(fl !=-1) { | 291 | if(fl !=-1) { |
292 | ioctl( fl, 2 ); | 292 | ioctl( fl, 2 ); |
@@ -296,9 +296,9 @@ void MediaPlayer::blank( bool b ) { | |||
296 | ioctl( fd, FBIOBLANK, 3 ); | 296 | ioctl( fd, FBIOBLANK, 3 ); |
297 | #endif | 297 | #endif |
298 | isBlanked = TRUE; | 298 | isBlanked = TRUE; |
299 | } else { | 299 | } else { |
300 | qDebug("do unblanking"); | 300 | odebug << "do unblanking" << oendl; |
301 | ioctl( fd, FBIOBLANK, 0); | 301 | ioctl( fd, FBIOBLANK, 0); |
302 | #ifdef QT_QWS_SL5XXX | 302 | #ifdef QT_QWS_SL5XXX |
303 | if(fl != -1) { | 303 | if(fl != -1) { |
304 | ioctl( fl, 1); | 304 | ioctl( fl, 1); |
@@ -308,9 +308,9 @@ void MediaPlayer::blank( bool b ) { | |||
308 | isBlanked = FALSE; | 308 | isBlanked = FALSE; |
309 | } | 309 | } |
310 | close( fd ); | 310 | close( fd ); |
311 | } else { | 311 | } else { |
312 | qDebug("<< /dev/fb0 could not be opened >>"); | 312 | odebug << "<< /dev/fb0 could not be opened >>" << oendl; |
313 | } | 313 | } |
314 | } | 314 | } |
315 | 315 | ||
316 | void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { | 316 | void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { |
@@ -324,13 +324,13 @@ void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { | |||
324 | break; | 324 | break; |
325 | case Key_F11: //menu | 325 | case Key_F11: //menu |
326 | break; | 326 | break; |
327 | case Key_F12: //home | 327 | case Key_F12: //home |
328 | qDebug("Blank here"); | 328 | odebug << "Blank here" << oendl; |
329 | // mediaPlayerState->toggleBlank(); | 329 | // mediaPlayerState->toggleBlank(); |
330 | break; | 330 | break; |
331 | case Key_F13: //mail | 331 | case Key_F13: //mail |
332 | qDebug("Blank here"); | 332 | odebug << "Blank here" << oendl; |
333 | // mediaPlayerState->toggleBlank(); | 333 | // mediaPlayerState->toggleBlank(); |
334 | break; | 334 | break; |
335 | } | 335 | } |
336 | } | 336 | } |
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 | |||
@@ -36,32 +36,32 @@ | |||
36 | //extern PlayListWidget *playList; | 36 | //extern PlayListWidget *playList; |
37 | 37 | ||
38 | Om3u::Om3u( const QString &filePath, int mode) | 38 | Om3u::Om3u( const QString &filePath, int mode) |
39 | : QStringList (){ | 39 | : QStringList (){ |
40 | qDebug("<<<<<<<new m3u "+filePath); | 40 | odebug << "<<<<<<<new m3u "+filePath << oendl; |
41 | f.setName(filePath); | 41 | f.setName(filePath); |
42 | f.open(mode); | 42 | f.open(mode); |
43 | } | 43 | } |
44 | 44 | ||
45 | Om3u::~Om3u(){} | 45 | Om3u::~Om3u(){} |
46 | 46 | ||
47 | void Om3u::readM3u() { | 47 | void Om3u::readM3u() { |
48 | // qDebug("<<<<<<reading m3u "+f.name()); | 48 | // odebug << "<<<<<<reading m3u "+f.name() << oendl; |
49 | QTextStream t(&f); | 49 | QTextStream t(&f); |
50 | t.setEncoding(QTextStream::UnicodeUTF8); | 50 | t.setEncoding(QTextStream::UnicodeUTF8); |
51 | QString s; | 51 | QString s; |
52 | while ( !t.atEnd() ) { | 52 | while ( !t.atEnd() ) { |
53 | s=t.readLine(); | 53 | s=t.readLine(); |
54 | // qDebug(s); | 54 | // odebug << s << oendl; |
55 | if( s.find( "#", 0, TRUE) == -1 ) { | 55 | if( s.find( "#", 0, TRUE) == -1 ) { |
56 | if( s.left(2) == "E:" || s.left(2) == "P:" ) { | 56 | if( s.left(2) == "E:" || s.left(2) == "P:" ) { |
57 | s = s.right( s.length() -2 ); | 57 | s = s.right( s.length() -2 ); |
58 | QFileInfo f( s ); | 58 | QFileInfo f( s ); |
59 | QString name = f.baseName(); | 59 | QString name = f.baseName(); |
60 | name = name.right( name.length() - name.findRev( "\\", -1, TRUE ) -1 ); | 60 | name = name.right( name.length() - name.findRev( "\\", -1, TRUE ) -1 ); |
61 | s=s.replace( QRegExp( "\\" ), "/" ); | 61 | s=s.replace( QRegExp( "\\" ), "/" ); |
62 | append(s); | 62 | append(s); |
63 | // qDebug(s); | 63 | // odebug << s << oendl; |
64 | } else { // is url | 64 | } else { // is url |
65 | QString name; | 65 | QString name; |
66 | name = s; | 66 | name = s; |
67 | append(name); | 67 | append(name); |
@@ -79,9 +79,9 @@ void Om3u::readPls() { //it's a pls file | |||
79 | if( s.left(4) == "File" ) { | 79 | if( s.left(4) == "File" ) { |
80 | s = s.right( s.length() - s.find("=",0,true)-1 ); | 80 | s = s.right( s.length() - s.find("=",0,true)-1 ); |
81 | s = s.stripWhiteSpace(); | 81 | s = s.stripWhiteSpace(); |
82 | s.replace( QRegExp( "%20" )," "); | 82 | s.replace( QRegExp( "%20" )," "); |
83 | // qDebug( "adding " + s + " to playlist" ); | 83 | // odebug << "adding " + s + " to playlist" << oendl; |
84 | // numberofentries=2 | 84 | // numberofentries=2 |
85 | // File1=http | 85 | // File1=http |
86 | // Title | 86 | // Title |
87 | // Length | 87 | // Length |
@@ -113,9 +113,9 @@ void Om3u::write() { //writes list to m3u file | |||
113 | QTextStream t(&f); | 113 | QTextStream t(&f); |
114 | t.setEncoding(QTextStream::UnicodeUTF8); | 114 | t.setEncoding(QTextStream::UnicodeUTF8); |
115 | if(count()>0) { | 115 | if(count()>0) { |
116 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { | 116 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { |
117 | // qDebug(*it); | 117 | // odebug << *it << oendl; |
118 | t << *it << "\n"; | 118 | t << *it << "\n"; |
119 | } | 119 | } |
120 | } | 120 | } |
121 | // f.close(); | 121 | // f.close(); |
@@ -129,9 +129,9 @@ void Om3u::remove(const QString &filePath) { //removes from m3u list | |||
129 | QString list, currentFile; | 129 | QString list, currentFile; |
130 | if(count()>0) { | 130 | if(count()>0) { |
131 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { | 131 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { |
132 | currentFile=*it; | 132 | currentFile=*it; |
133 | // qDebug(*it); | 133 | // odebug << *it << oendl; |
134 | 134 | ||
135 | if( filePath != currentFile) | 135 | if( filePath != currentFile) |
136 | list += currentFile+"\n"; | 136 | list += currentFile+"\n"; |
137 | } | 137 | } |
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 | |||
@@ -43,9 +43,9 @@ private: | |||
43 | 43 | ||
44 | PlayListSelection::PlayListSelection( QWidget *parent, const char *name ) | 44 | PlayListSelection::PlayListSelection( QWidget *parent, const char *name ) |
45 | : QListView( parent, name ) | 45 | : QListView( parent, name ) |
46 | { | 46 | { |
47 | // qDebug("starting playlistselector"); | 47 | // odebug << "starting playlistselector" << oendl; |
48 | // #ifdef USE_PLAYLIST_BACKGROUND | 48 | // #ifdef USE_PLAYLIST_BACKGROUND |
49 | // setStaticBackground( TRUE ); | 49 | // setStaticBackground( TRUE ); |
50 | // setBackgroundPixmap( Resource::loadPixmap( "opieplayer/background" ) ); | 50 | // setBackgroundPixmap( Resource::loadPixmap( "opieplayer/background" ) ); |
51 | 51 | ||
@@ -64,9 +64,9 @@ PlayListSelection::~PlayListSelection() { | |||
64 | 64 | ||
65 | 65 | ||
66 | // #ifdef USE_PLAYLIST_BACKGROUND | 66 | // #ifdef USE_PLAYLIST_BACKGROUND |
67 | void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) { | 67 | void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) { |
68 | // qDebug("drawBackground"); | 68 | // odebug << "drawBackground" << oendl; |
69 | p->fillRect( r, QBrush( white ) ); | 69 | p->fillRect( r, QBrush( white ) ); |
70 | // QImage logo = Resource::loadImage( "launcher/opielogo" ); | 70 | // QImage logo = Resource::loadImage( "launcher/opielogo" ); |
71 | // if ( !logo.isNull() ) | 71 | // if ( !logo.isNull() ) |
72 | // p->drawImage( (width() - logo.width()) / 2, (height() - logo.height()) / 2, logo ); | 72 | // p->drawImage( (width() - logo.width()) / 2, (height() - logo.height()) / 2, logo ); |
@@ -183,20 +183,20 @@ void PlayListSelection::writeCurrent( Config& cfg ) { | |||
183 | cfg.setGroup("PlayList"); | 183 | cfg.setGroup("PlayList"); |
184 | QListViewItem *item = selectedItem(); | 184 | QListViewItem *item = selectedItem(); |
185 | if ( item ) | 185 | if ( item ) |
186 | cfg.writeEntry("current", item->text(0) ); | 186 | cfg.writeEntry("current", item->text(0) ); |
187 | qDebug(item->text(0)); | 187 | odebug << item->text(0) << oendl; |
188 | 188 | ||
189 | } | 189 | } |
190 | 190 | ||
191 | void PlayListSelection::setSelectedItem(const QString &strk ) { | 191 | void PlayListSelection::setSelectedItem(const QString &strk ) { |
192 | 192 | ||
193 | unSelect(); | 193 | unSelect(); |
194 | QListViewItemIterator it( this ); | 194 | QListViewItemIterator it( this ); |
195 | for ( ; it.current(); ++it ) { | 195 | for ( ; it.current(); ++it ) { |
196 | // qDebug( it.current()->text(0)); | 196 | // odebug << it.current()->text(0) << oendl; |
197 | if( strk == it.current()->text(0)) { | 197 | if( strk == it.current()->text(0)) { |
198 | // qDebug( "We have a match "+strk); | 198 | // odebug << "We have a match "+strk << oendl; |
199 | setSelected( it.current(), TRUE); | 199 | setSelected( it.current(), TRUE); |
200 | ensureItemVisible( it.current() ); | 200 | ensureItemVisible( it.current() ); |
201 | return; | 201 | return; |
202 | } | 202 | } |
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 | |||
@@ -181,13 +181,13 @@ void PlayListWidget::writeDefaultPlaylist() { | |||
181 | QString filename=QPEApplication::documentDir() + "/default.m3u"; | 181 | QString filename=QPEApplication::documentDir() + "/default.m3u"; |
182 | QString currentString = config.readEntry( "CurrentPlaylist", filename); | 182 | QString currentString = config.readEntry( "CurrentPlaylist", filename); |
183 | if( currentString == filename) { | 183 | if( currentString == filename) { |
184 | Om3u *m3uList; | 184 | Om3u *m3uList; |
185 | // qDebug("<<<<<<<<<<<<<default>>>>>>>>>>>>>>>>>>>"); | 185 | // odebug << "<<<<<<<<<<<<<default>>>>>>>>>>>>>>>>>>>" << oendl; |
186 | if( d->selectedFiles->first() ) { | 186 | if( d->selectedFiles->first() ) { |
187 | m3uList = new Om3u(filename, IO_ReadWrite | IO_Truncate); | 187 | m3uList = new Om3u(filename, IO_ReadWrite | IO_Truncate); |
188 | do { | 188 | do { |
189 | // qDebug(d->selectedFiles->current()->file()); | 189 | // odebug << d->selectedFiles->current()->file() << oendl; |
190 | m3uList->add( d->selectedFiles->current()->file() ); | 190 | m3uList->add( d->selectedFiles->current()->file() ); |
191 | } | 191 | } |
192 | while ( d->selectedFiles->next() ); | 192 | while ( d->selectedFiles->next() ); |
193 | 193 | ||
@@ -324,9 +324,9 @@ void PlayListWidget::addAllVideoToList() { | |||
324 | } | 324 | } |
325 | 325 | ||
326 | 326 | ||
327 | void PlayListWidget::setDocument( const QString& fileref ) { | 327 | void PlayListWidget::setDocument( const QString& fileref ) { |
328 | // qDebug( "<<<<<<<<set document>>>>>>>>>> "+fileref ); | 328 | // odebug << "<<<<<<<<set document>>>>>>>>>> "+fileref << oendl; |
329 | fromSetDocument = TRUE; | 329 | fromSetDocument = TRUE; |
330 | QFileInfo fileInfo(fileref); | 330 | QFileInfo fileInfo(fileref); |
331 | 331 | ||
332 | if ( !fileInfo.exists() ) { | 332 | if ( !fileInfo.exists() ) { |
@@ -400,9 +400,9 @@ bool PlayListWidget::prev() { | |||
400 | } | 400 | } |
401 | 401 | ||
402 | 402 | ||
403 | bool PlayListWidget::next() { | 403 | bool PlayListWidget::next() { |
404 | //qDebug("<<<<<<<<<<<<next()"); | 404 | //odebug << "<<<<<<<<<<<<next()" << oendl; |
405 | if ( mediaPlayerState->isShuffled() ) { | 405 | if ( mediaPlayerState->isShuffled() ) { |
406 | return prev(); | 406 | return prev(); |
407 | } else { | 407 | } else { |
408 | if ( !d->selectedFiles->next() ) { | 408 | if ( !d->selectedFiles->next() ) { |
@@ -611,9 +611,9 @@ void PlayListWidget::openURL() { | |||
611 | fileDlg = new InputDialog(this,tr("Add URL"),TRUE, 0); | 611 | fileDlg = new InputDialog(this,tr("Add URL"),TRUE, 0); |
612 | fileDlg->exec(); | 612 | fileDlg->exec(); |
613 | if( fileDlg->result() == 1 ) { | 613 | if( fileDlg->result() == 1 ) { |
614 | filename = fileDlg->text(); | 614 | filename = fileDlg->text(); |
615 | qDebug( "Selected filename is " + filename ); | 615 | odebug << "Selected filename is " + filename << oendl; |
616 | // Om3u *m3uList; | 616 | // Om3u *m3uList; |
617 | DocLnk lnk; | 617 | DocLnk lnk; |
618 | Config cfg( "OpiePlayer" ); | 618 | Config cfg( "OpiePlayer" ); |
619 | cfg.setGroup("PlayList"); | 619 | cfg.setGroup("PlayList"); |
@@ -687,9 +687,9 @@ void PlayListWidget::openFile() { | |||
687 | cfg.writeEntry( "LastDirectory" ,QFileInfo( str ).dirPath() ); | 687 | cfg.writeEntry( "LastDirectory" ,QFileInfo( str ).dirPath() ); |
688 | 688 | ||
689 | if( !str.isEmpty() ) { | 689 | if( !str.isEmpty() ) { |
690 | 690 | ||
691 | qDebug( "Selected filename is " + str ); | 691 | odebug << "Selected filename is " + str << oendl; |
692 | filename = str; | 692 | filename = str; |
693 | DocLnk lnk; | 693 | DocLnk lnk; |
694 | 694 | ||
695 | if( filename.right( 3) == "m3u" || filename.right(3) == "pls" ) { | 695 | if( filename.right( 3) == "m3u" || filename.right(3) == "pls" ) { |
@@ -705,9 +705,9 @@ void PlayListWidget::openFile() { | |||
705 | } | 705 | } |
706 | 706 | ||
707 | 707 | ||
708 | void PlayListWidget::readListFromFile( const QString &filename ) { | 708 | void PlayListWidget::readListFromFile( const QString &filename ) { |
709 | qDebug( "read list filename " + filename ); | 709 | odebug << "read list filename " + filename << oendl; |
710 | QFileInfo fi(filename); | 710 | QFileInfo fi(filename); |
711 | Om3u *m3uList; | 711 | Om3u *m3uList; |
712 | QString s, name; | 712 | QString s, name; |
713 | m3uList = new Om3u( filename, IO_ReadOnly ); | 713 | m3uList = new Om3u( filename, IO_ReadOnly ); |
@@ -718,9 +718,9 @@ void PlayListWidget::readListFromFile( const QString &filename ) { | |||
718 | 718 | ||
719 | DocLnk lnk; | 719 | DocLnk lnk; |
720 | for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) { | 720 | for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) { |
721 | s = *it; | 721 | s = *it; |
722 | // qDebug(s); | 722 | // odebug << s << oendl; |
723 | if(s.left(4)=="http") { | 723 | if(s.left(4)=="http") { |
724 | lnk.setName( s ); //sets file name | 724 | lnk.setName( s ); //sets file name |
725 | lnk.setIcon("opieplayer2/musicfile"); | 725 | lnk.setIcon("opieplayer2/musicfile"); |
726 | lnk.setFile( s ); //sets file name | 726 | lnk.setFile( s ); //sets file name |
@@ -752,9 +752,9 @@ void PlayListWidget::readListFromFile( const QString &filename ) { | |||
752 | } | 752 | } |
753 | 753 | ||
754 | // writes current playlist to current m3u file */ | 754 | // writes current playlist to current m3u file */ |
755 | void PlayListWidget::writeCurrentM3u() { | 755 | void PlayListWidget::writeCurrentM3u() { |
756 | qDebug("writing to current m3u"); | 756 | odebug << "writing to current m3u" << oendl; |
757 | Config cfg( "OpiePlayer" ); | 757 | Config cfg( "OpiePlayer" ); |
758 | cfg.setGroup("PlayList"); | 758 | cfg.setGroup("PlayList"); |
759 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist","default"); | 759 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist","default"); |
760 | 760 | ||
@@ -762,13 +762,13 @@ void PlayListWidget::readListFromFile( const QString &filename ) { | |||
762 | m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate ); | 762 | m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate ); |
763 | if( d->selectedFiles->first()) { | 763 | if( d->selectedFiles->first()) { |
764 | 764 | ||
765 | do { | 765 | do { |
766 | // qDebug( "add writeCurrentM3u " +d->selectedFiles->current()->file()); | 766 | // odebug << "add writeCurrentM3u " +d->selectedFiles->current()->file() << oendl; |
767 | m3uList->add( d->selectedFiles->current()->file() ); | 767 | m3uList->add( d->selectedFiles->current()->file() ); |
768 | } | 768 | } |
769 | while ( d->selectedFiles->next() ); | 769 | while ( d->selectedFiles->next() ); |
770 | // qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" ); | 770 | // odebug << "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" << oendl; |
771 | m3uList->write(); | 771 | m3uList->write(); |
772 | m3uList->close(); | 772 | m3uList->close(); |
773 | } | 773 | } |
774 | delete m3uList; | 774 | delete m3uList; |
@@ -811,9 +811,9 @@ void PlayListWidget::writem3u() { | |||
811 | 811 | ||
812 | if( !str.isEmpty() ) { | 812 | if( !str.isEmpty() ) { |
813 | name = str; | 813 | name = str; |
814 | // name = fileDlg->text(); | 814 | // name = fileDlg->text(); |
815 | // qDebug( filename ); | 815 | // odebug << filename << oendl; |
816 | if( name.find("/",0,true) != -1) {// assume they specify a file path | 816 | if( name.find("/",0,true) != -1) {// assume they specify a file path |
817 | filename = name; | 817 | filename = name; |
818 | name = name.right(name.length()- name.findRev("/",-1,true) - 1 ); | 818 | name = name.right(name.length()- name.findRev("/",-1,true) - 1 ); |
819 | } | 819 | } |
@@ -829,9 +829,9 @@ void PlayListWidget::writem3u() { | |||
829 | do { | 829 | do { |
830 | m3uList->add( d->selectedFiles->current()->file()); | 830 | m3uList->add( d->selectedFiles->current()->file()); |
831 | } | 831 | } |
832 | while ( d->selectedFiles->next() ); | 832 | while ( d->selectedFiles->next() ); |
833 | // qDebug( list ); | 833 | // odebug << list << oendl; |
834 | m3uList->write(); | 834 | m3uList->write(); |
835 | m3uList->close(); | 835 | m3uList->close(); |
836 | delete m3uList; | 836 | delete m3uList; |
837 | 837 | ||
@@ -841,17 +841,17 @@ void PlayListWidget::writem3u() { | |||
841 | lnk.setFile( filename); | 841 | lnk.setFile( filename); |
842 | lnk.setIcon("opieplayer2/playlist2"); | 842 | lnk.setIcon("opieplayer2/playlist2"); |
843 | lnk.setName( name); //sets file name | 843 | lnk.setName( name); //sets file name |
844 | 844 | ||
845 | // qDebug(filename); | 845 | // odebug << filename << oendl; |
846 | Config config( "OpiePlayer" ); | 846 | Config config( "OpiePlayer" ); |
847 | config.setGroup( "PlayList" ); | 847 | config.setGroup( "PlayList" ); |
848 | 848 | ||
849 | config.writeEntry("CurrentPlaylist",filename); | 849 | config.writeEntry("CurrentPlaylist",filename); |
850 | currentPlayList=filename; | 850 | currentPlayList=filename; |
851 | 851 | ||
852 | if(!lnk.writeLink()) { | 852 | if(!lnk.writeLink()) { |
853 | qDebug("Writing doclink did not work"); | 853 | odebug << "Writing doclink did not work" << oendl; |
854 | } | 854 | } |
855 | 855 | ||
856 | setCaption(tr("OpiePlayer: ") + name); | 856 | setCaption(tr("OpiePlayer: ") + name); |
857 | } | 857 | } |
@@ -883,9 +883,9 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) { | |||
883 | case Key_R: //remove from playlist | 883 | case Key_R: //remove from playlist |
884 | removeSelected(); | 884 | removeSelected(); |
885 | break; | 885 | break; |
886 | // case Key_P: //play | 886 | // case Key_P: //play |
887 | // qDebug("Play"); | 887 | // odebug << "Play" << oendl; |
888 | // playSelected(); | 888 | // playSelected(); |
889 | // break; | 889 | // break; |
890 | case Key_Space: | 890 | case Key_Space: |
891 | // playSelected(); puh | 891 | // playSelected(); puh |
@@ -913,9 +913,9 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) { | |||
913 | } | 913 | } |
914 | } | 914 | } |
915 | 915 | ||
916 | void PlayListWidget::pmViewActivated(int index) { | 916 | void PlayListWidget::pmViewActivated(int index) { |
917 | // qDebug("%d", index); | 917 | // odebug << "" << index << "" << oendl; |
918 | switch(index) { | 918 | switch(index) { |
919 | case -16: | 919 | case -16: |
920 | { | 920 | { |
921 | mediaPlayerState->toggleFullscreen(); | 921 | mediaPlayerState->toggleFullscreen(); |
@@ -943,9 +943,9 @@ void PlayListWidget::populateSkinsMenu() { | |||
943 | QFileInfoListIterator it( *skinslist ); | 943 | QFileInfoListIterator it( *skinslist ); |
944 | QFileInfo *fi; | 944 | QFileInfo *fi; |
945 | while ( ( fi = it.current() ) ) { | 945 | while ( ( fi = it.current() ) ) { |
946 | skinName = fi->fileName(); | 946 | skinName = fi->fileName(); |
947 | // qDebug( fi->fileName() ); | 947 | // odebug << fi->fileName() << oendl; |
948 | if( skinName != "." && skinName != ".." && skinName !="CVS" ) { | 948 | if( skinName != "." && skinName != ".." && skinName !="CVS" ) { |
949 | item = skinsMenu->insertItem( fi->fileName() ) ; | 949 | item = skinsMenu->insertItem( fi->fileName() ) ; |
950 | } | 950 | } |
951 | if( skinName == "default" ) { | 951 | if( skinName == "default" ) { |
@@ -999,9 +999,9 @@ QString PlayListWidget::currentFileListPathName() const { | |||
999 | } | 999 | } |
1000 | 1000 | ||
1001 | 1001 | ||
1002 | void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { | 1002 | void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { |
1003 | qDebug("qcop message "+msg ); | 1003 | odebug << "qcop message "+msg << oendl; |
1004 | QDataStream stream ( data, IO_ReadOnly ); | 1004 | QDataStream stream ( data, IO_ReadOnly ); |
1005 | if ( msg == "play()" ) { //plays current selection | 1005 | if ( msg == "play()" ) { //plays current selection |
1006 | btnPlay( true); | 1006 | btnPlay( true); |
1007 | } else if ( msg == "stop()" ) { | 1007 | } else if ( msg == "stop()" ) { |
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 | |||
@@ -182,9 +182,9 @@ void PlayListWidgetGui::setView( char view ) { | |||
182 | } | 182 | } |
183 | 183 | ||
184 | 184 | ||
185 | void PlayListWidgetGui::setActiveWindow() { | 185 | void PlayListWidgetGui::setActiveWindow() { |
186 | // qDebug("SETTING active window"); | 186 | // odebug << "SETTING active window" << oendl; |
187 | // When we get raised we need to ensure that it switches views | 187 | // When we get raised we need to ensure that it switches views |
188 | MediaPlayerState::DisplayType origDisplayType = mediaPlayerState->displayType(); | 188 | MediaPlayerState::DisplayType origDisplayType = mediaPlayerState->displayType(); |
189 | mediaPlayerState->setDisplayType( MediaPlayerState::MediaSelection ); // invalidate | 189 | mediaPlayerState->setDisplayType( MediaPlayerState::MediaSelection ); // invalidate |
190 | mediaPlayerState->setDisplayType( origDisplayType ); // now switch back | 190 | mediaPlayerState->setDisplayType( origDisplayType ); // now switch back |
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 | |||
@@ -177,13 +177,13 @@ SkinData *SkinCache::lookupAndTake( const QString &skinPath, const QString &file | |||
177 | SkinData *data = m_cache.take( key ); | 177 | SkinData *data = m_cache.take( key ); |
178 | if ( !data ) | 178 | if ( !data ) |
179 | data = new SkinData; | 179 | data = new SkinData; |
180 | else | 180 | else |
181 | qDebug( "SkinCache: hit" ); | 181 | odebug << "SkinCache: hit" << oendl; |
182 | 182 | ||
183 | QPixmap *bgPixmap = m_backgroundPixmapCache.find( skinPath ); | 183 | QPixmap *bgPixmap = m_backgroundPixmapCache.find( skinPath ); |
184 | if ( bgPixmap ) { | 184 | if ( bgPixmap ) { |
185 | qDebug( "SkinCache: hit on bgpixmap" ); | 185 | odebug << "SkinCache: hit on bgpixmap" << oendl; |
186 | data->backgroundPixmap = *bgPixmap; | 186 | data->backgroundPixmap = *bgPixmap; |
187 | } | 187 | } |
188 | else | 188 | else |
189 | data->backgroundPixmap = QPixmap(); | 189 | data->backgroundPixmap = QPixmap(); |
@@ -217,34 +217,34 @@ SkinLoader::IncrementalLoader::IncrementalLoader( const Info &info ) | |||
217 | SkinLoader::IncrementalLoader::LoaderResult SkinLoader::IncrementalLoader::loadStep() | 217 | SkinLoader::IncrementalLoader::LoaderResult SkinLoader::IncrementalLoader::loadStep() |
218 | { | 218 | { |
219 | switch ( m_currentState ) { | 219 | switch ( m_currentState ) { |
220 | case LoadBackgroundPixmap: | 220 | case LoadBackgroundPixmap: |
221 | qDebug( "load bgpixmap" ); | 221 | odebug << "load bgpixmap" << oendl; |
222 | m_skin.backgroundPixmap(); | 222 | m_skin.backgroundPixmap(); |
223 | m_currentState = LoadButtonUpImage; | 223 | m_currentState = LoadButtonUpImage; |
224 | break; | 224 | break; |
225 | case LoadButtonUpImage: | 225 | case LoadButtonUpImage: |
226 | qDebug( "load upimage" ); | 226 | odebug << "load upimage" << oendl; |
227 | m_skin.buttonUpImage(); | 227 | m_skin.buttonUpImage(); |
228 | m_currentState = LoadButtonDownImage; | 228 | m_currentState = LoadButtonDownImage; |
229 | break; | 229 | break; |
230 | case LoadButtonDownImage: | 230 | case LoadButtonDownImage: |
231 | qDebug( "load downimage" ); | 231 | odebug << "load downimage" << oendl; |
232 | m_skin.buttonDownImage(); | 232 | m_skin.buttonDownImage(); |
233 | m_currentState = LoadButtonMasks; | 233 | m_currentState = LoadButtonMasks; |
234 | m_currentButton = 0; | 234 | m_currentButton = 0; |
235 | break; | 235 | break; |
236 | case LoadButtonMasks: | 236 | case LoadButtonMasks: |
237 | qDebug( "load button masks %i", m_currentButton ); | 237 | odebug << "load button masks " << m_currentButton << "" << oendl; |
238 | m_skin.buttonMaskImage( m_info.buttonInfo[ m_currentButton ].fileName ); | 238 | m_skin.buttonMaskImage( m_info.buttonInfo[ m_currentButton ].fileName ); |
239 | 239 | ||
240 | m_currentButton++; | 240 | m_currentButton++; |
241 | if ( m_currentButton >= m_info.buttonCount ) | 241 | if ( m_currentButton >= m_info.buttonCount ) |
242 | m_currentState = LoadButtonMask; | 242 | m_currentState = LoadButtonMask; |
243 | 243 | ||
244 | break; | 244 | break; |
245 | case LoadButtonMask: | 245 | case LoadButtonMask: |
246 | qDebug( "load whole mask" ); | 246 | odebug << "load whole mask" << oendl; |
247 | m_skin.buttonMask( m_info.buttonInfo, m_info.buttonCount ); | 247 | m_skin.buttonMask( m_info.buttonInfo, m_info.buttonCount ); |
248 | return LoadingCompleted; | 248 | return LoadingCompleted; |
249 | } | 249 | } |
250 | 250 | ||
@@ -257,9 +257,9 @@ SkinLoader::SkinLoader() | |||
257 | } | 257 | } |
258 | 258 | ||
259 | SkinLoader::~SkinLoader() | 259 | SkinLoader::~SkinLoader() |
260 | { | 260 | { |
261 | qDebug( "SkinLoader::~SkinLoader()" ); | 261 | odebug << "SkinLoader::~SkinLoader()" << oendl; |
262 | killTimers(); | 262 | killTimers(); |
263 | delete m_currentLoader; | 263 | delete m_currentLoader; |
264 | } | 264 | } |
265 | 265 | ||
@@ -276,9 +276,9 @@ void SkinLoader::schedule( const QString &skinName, const MediaWidget::GUIInfo & | |||
276 | void SkinLoader::start() | 276 | void SkinLoader::start() |
277 | { | 277 | { |
278 | assert( m_timerId == -1 ); | 278 | assert( m_timerId == -1 ); |
279 | m_timerId = startTimer( 100 /* ms */ ); | 279 | m_timerId = startTimer( 100 /* ms */ ); |
280 | qDebug( "SkinLoader::start() %d jobs", pendingSkins.count() ); | 280 | odebug << "SkinLoader::start() " << pendingSkins.count() << " jobs" << oendl; |
281 | } | 281 | } |
282 | 282 | ||
283 | void SkinLoader::timerEvent( QTimerEvent *ev ) | 283 | void SkinLoader::timerEvent( QTimerEvent *ev ) |
284 | { | 284 | { |
@@ -289,9 +289,9 @@ void SkinLoader::timerEvent( QTimerEvent *ev ) | |||
289 | 289 | ||
290 | if ( !m_currentLoader ) { | 290 | if ( !m_currentLoader ) { |
291 | 291 | ||
292 | if ( pendingSkins.isEmpty() ) { | 292 | if ( pendingSkins.isEmpty() ) { |
293 | qDebug( "all jobs done" ); | 293 | odebug << "all jobs done" << oendl; |
294 | killTimer( m_timerId ); | 294 | killTimer( m_timerId ); |
295 | m_timerId = -1; | 295 | m_timerId = -1; |
296 | // ### qt3: use deleteLater(); | 296 | // ### qt3: use deleteLater(); |
297 | QTimer::singleShot( 0, this, SLOT( deleteMe() ) ); | 297 | QTimer::singleShot( 0, this, SLOT( deleteMe() ) ); |
@@ -301,17 +301,17 @@ void SkinLoader::timerEvent( QTimerEvent *ev ) | |||
301 | Info nfo = *pendingSkins.begin(); | 301 | Info nfo = *pendingSkins.begin(); |
302 | pendingSkins.remove( pendingSkins.begin() ); | 302 | pendingSkins.remove( pendingSkins.begin() ); |
303 | 303 | ||
304 | m_currentLoader = new IncrementalLoader( nfo ); | 304 | m_currentLoader = new IncrementalLoader( nfo ); |
305 | qDebug( "new loader %i jobs left", pendingSkins.count() ); | 305 | odebug << "new loader " << pendingSkins.count() << " jobs left" << oendl; |
306 | } | 306 | } |
307 | 307 | ||
308 | if ( m_currentLoader->loadStep() == IncrementalLoader::LoadingCompleted ) { | 308 | if ( m_currentLoader->loadStep() == IncrementalLoader::LoadingCompleted ) { |
309 | delete m_currentLoader; | 309 | delete m_currentLoader; |
310 | m_currentLoader = 0; | 310 | m_currentLoader = 0; |
311 | } | 311 | } |
312 | 312 | ||
313 | qDebug( "finished step" ); | 313 | odebug << "finished step" << oendl; |
314 | } | 314 | } |
315 | 315 | ||
316 | void SkinLoader::deleteMe() | 316 | void SkinLoader::deleteMe() |
317 | { | 317 | { |
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 | |||
@@ -186,18 +186,18 @@ void Thread::start() | |||
186 | { | 186 | { |
187 | AutoLock lock( d->guard ); | 187 | AutoLock lock( d->guard ); |
188 | 188 | ||
189 | if ( d->isRunning ) { | 189 | if ( d->isRunning ) { |
190 | qDebug( "ThreadUtil::Thread::start() called for running thread." ); | 190 | odebug << "ThreadUtil::Thread::start() called for running thread." << oendl; |
191 | return; | 191 | return; |
192 | } | 192 | } |
193 | 193 | ||
194 | pthread_attr_t attributes; | 194 | pthread_attr_t attributes; |
195 | pthread_attr_init( &attributes ); | 195 | pthread_attr_init( &attributes ); |
196 | pthread_attr_setscope( &attributes, PTHREAD_SCOPE_SYSTEM ); | 196 | pthread_attr_setscope( &attributes, PTHREAD_SCOPE_SYSTEM ); |
197 | int err = pthread_create( &d->self, &attributes, start_thread, ( void* )d ); | 197 | int err = pthread_create( &d->self, &attributes, start_thread, ( void* )d ); |
198 | if ( err != 0 ) { | 198 | if ( err != 0 ) { |
199 | qDebug( "ThreadUtil::Thread::start() : can't create thread: %s", strerror( err ) ); | 199 | odebug << "ThreadUtil::Thread::start() : can't create thread: " << strerror( err ) << "" << oendl; |
200 | pthread_attr_destroy( &attributes ); | 200 | pthread_attr_destroy( &attributes ); |
201 | return; | 201 | return; |
202 | } | 202 | } |
203 | pthread_attr_destroy( &attributes ); | 203 | pthread_attr_destroy( &attributes ); |
@@ -283,9 +283,9 @@ ChannelMessage::~ChannelMessage() | |||
283 | void ChannelMessage::reply() | 283 | void ChannelMessage::reply() |
284 | { | 284 | { |
285 | if ( !m_isCall ) | 285 | if ( !m_isCall ) |
286 | { | 286 | { |
287 | qDebug( "ChannelMessage::reply() - can't reply oneway message!" ); | 287 | odebug << "ChannelMessage::reply() - can't reply oneway message!" << oendl; |
288 | return; | 288 | return; |
289 | } | 289 | } |
290 | 290 | ||
291 | if ( m_inEventHandler ) | 291 | if ( m_inEventHandler ) |
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 | |||
@@ -92,9 +92,9 @@ void XineControl::play( const QString& fileName ) { | |||
92 | hasVideoChannel = FALSE; | 92 | hasVideoChannel = FALSE; |
93 | hasAudioChannel = FALSE; | 93 | hasAudioChannel = FALSE; |
94 | m_fileName = fileName; | 94 | m_fileName = fileName; |
95 | 95 | ||
96 | qDebug("<<FILENAME: " + fileName + ">>>>"); | 96 | odebug << "<<FILENAME: " + fileName + ">>>>" << oendl; |
97 | 97 | ||
98 | if ( !libXine->play( fileName, 0, 0 ) ) { | 98 | if ( !libXine->play( fileName, 0, 0 ) ) { |
99 | QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() ); | 99 | QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() ); |
100 | // toggle stop so the the play button is reset | 100 | // toggle stop so the the play button is reset |
@@ -105,14 +105,14 @@ void XineControl::play( const QString& fileName ) { | |||
105 | 105 | ||
106 | MediaPlayerState::DisplayType displayType; | 106 | MediaPlayerState::DisplayType displayType; |
107 | if ( !libXine->hasVideo() ) { | 107 | if ( !libXine->hasVideo() ) { |
108 | displayType = MediaPlayerState::Audio; | 108 | displayType = MediaPlayerState::Audio; |
109 | qDebug("HAS AUDIO"); | 109 | odebug << "HAS AUDIO" << oendl; |
110 | libXine->setShowVideo( false ); | 110 | libXine->setShowVideo( false ); |
111 | hasAudioChannel = TRUE; | 111 | hasAudioChannel = TRUE; |
112 | } else { | 112 | } else { |
113 | displayType = MediaPlayerState::Video; | 113 | displayType = MediaPlayerState::Video; |
114 | qDebug("HAS VIDEO"); | 114 | odebug << "HAS VIDEO" << oendl; |
115 | libXine->setShowVideo( true ); | 115 | libXine->setShowVideo( true ); |
116 | hasVideoChannel = TRUE; | 116 | hasVideoChannel = TRUE; |
117 | } | 117 | } |
118 | // determine if slider is shown | 118 | // determine if slider is shown |
@@ -242,9 +242,9 @@ QString XineControl::getMetaInfo() { | |||
242 | QString XineControl::getErrorCode() { | 242 | QString XineControl::getErrorCode() { |
243 | 243 | ||
244 | int errorCode = libXine->error(); | 244 | int errorCode = libXine->error(); |
245 | 245 | ||
246 | qDebug( QString("ERRORCODE: %1 ").arg(errorCode) ); | 246 | odebug << QString("ERRORCODE: %1 ").arg(errorCode) << oendl; |
247 | 247 | ||
248 | if ( errorCode == 1 ) { | 248 | if ( errorCode == 1 ) { |
249 | return tr( "No input plugin found for this media type" ); | 249 | return tr( "No input plugin found for this media type" ); |
250 | } else if ( errorCode == 2 ) { | 250 | } else if ( errorCode == 2 ) { |
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 | |||
@@ -1,22 +1,22 @@ | |||
1 | // device.cpp | 1 | // device.cpp |
2 | 2 | ||
3 | #include "device.h" | 3 | #include "device.h" |
4 | 4 | ||
5 | /* OPIE */ | ||
6 | #include <opie2/odebug.h> | ||
5 | #include <qpe/config.h> | 7 | #include <qpe/config.h> |
6 | #include <qpe/qcopenvelope_qws.h> | 8 | #include <qpe/qcopenvelope_qws.h> |
9 | using namespace Opie::Core; | ||
7 | 10 | ||
8 | 11 | /* STD */ | |
9 | #include <fcntl.h> | 12 | #include <fcntl.h> |
10 | #include <stdio.h> | 13 | #include <stdio.h> |
11 | #include <stdlib.h> | 14 | #include <stdlib.h> |
12 | #include <sys/ioctl.h> | 15 | #include <sys/ioctl.h> |
13 | #include <sys/soundcard.h> | 16 | #include <sys/soundcard.h> |
14 | #include <unistd.h> | 17 | #include <unistd.h> |
15 | #include<sys/wait.h> | 18 | #include <sys/wait.h> |
16 | // #include <sys/stat.h> | ||
17 | // #include <sys/time.h> | ||
18 | // #include <sys/types.h> | ||
19 | #include <unistd.h> | 19 | #include <unistd.h> |
20 | #include <errno.h> | 20 | #include <errno.h> |
21 | 21 | ||
22 | //extern QtRec *qperec; | 22 | //extern QtRec *qperec; |
@@ -31,12 +31,12 @@ Device::Device( QObject * parent, const char * dsp, const char * mixr, bool reco | |||
31 | devCh=-1; | 31 | devCh=-1; |
32 | devRate=-1; | 32 | devRate=-1; |
33 | 33 | ||
34 | if( !record){ //playing | 34 | if( !record){ //playing |
35 | qDebug("setting up DSP for playing"); | 35 | odebug << "setting up DSP for playing" << oendl; |
36 | flags = O_WRONLY; | 36 | flags = O_WRONLY; |
37 | } else { //recording | 37 | } else { //recording |
38 | qDebug("setting up DSP for recording"); | 38 | odebug << "setting up DSP for recording" << oendl; |
39 | flags = O_RDWR; | 39 | flags = O_RDWR; |
40 | // flags = O_RDONLY; | 40 | // flags = O_RDONLY; |
41 | 41 | ||
42 | // selectMicInput(); | 42 | // selectMicInput(); |
@@ -95,9 +95,9 @@ void Device::changedOutVolume(int vol) { | |||
95 | Config cfg("qpe"); | 95 | Config cfg("qpe"); |
96 | cfg.setGroup("Volume"); | 96 | cfg.setGroup("Volume"); |
97 | cfg.writeEntry("VolumePercent", QString::number( vol )); | 97 | cfg.writeEntry("VolumePercent", QString::number( vol )); |
98 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false; | 98 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false; |
99 | qWarning("changing output vol %d", vol); | 99 | owarn << "changing output vol " << vol << "" << oendl; |
100 | } | 100 | } |
101 | ::close(fd); | 101 | ::close(fd); |
102 | } | 102 | } |
103 | 103 | ||
@@ -110,9 +110,9 @@ void Device::changedInVolume(int vol ) { | |||
110 | Config cfg("qpe"); | 110 | Config cfg("qpe"); |
111 | cfg.setGroup("Volume"); | 111 | cfg.setGroup("Volume"); |
112 | cfg.writeEntry("Mic", QString::number(vol )); | 112 | cfg.writeEntry("Mic", QString::number(vol )); |
113 | QCopEnvelope( "QPE/System", "micChange(bool)" ) << false; | 113 | QCopEnvelope( "QPE/System", "micChange(bool)" ) << false; |
114 | qWarning("changing input volume %d", vol); | 114 | owarn << "changing input volume " << vol << "" << oendl; |
115 | } | 115 | } |
116 | ::close(fd); | 116 | ::close(fd); |
117 | } | 117 | } |
118 | 118 | ||
@@ -148,24 +148,24 @@ exit(1); | |||
148 | perror("The fork failed!"); | 148 | perror("The fork failed!"); |
149 | break; | 149 | break; |
150 | case 0: { | 150 | case 0: { |
151 | */ | 151 | */ |
152 | qDebug("Opening %s",dspstr); | 152 | odebug << "Opening " << dspstr << "" << oendl; |
153 | if (( sd = ::open( dspstr, flags)) == -1) { | 153 | if (( sd = ::open( dspstr, flags)) == -1) { |
154 | perror("open(\"/dev/dsp\")"); | 154 | perror("open(\"/dev/dsp\")"); |
155 | QString errorMsg="Could not open audio device\n /dev/dsp\n" | 155 | QString errorMsg="Could not open audio device\n /dev/dsp\n" |
156 | +(QString)strerror(errno); | 156 | +(QString)strerror(errno); |
157 | qDebug("XXXXXXXXXXXXXXXXXXXXXXX "+errorMsg); | 157 | odebug << "XXXXXXXXXXXXXXXXXXXXXXX "+errorMsg << oendl; |
158 | return -1; | 158 | return -1; |
159 | } | 159 | } |
160 | 160 | ||
161 | qDebug("Opening mixer"); | 161 | odebug << "Opening mixer" << oendl; |
162 | int mixerHandle=0; | 162 | int mixerHandle=0; |
163 | if (( mixerHandle = open("/dev/mixer",O_RDWR))<0) { | 163 | if (( mixerHandle = open("/dev/mixer",O_RDWR))<0) { |
164 | perror("open(\"/dev/mixer\")"); | 164 | perror("open(\"/dev/mixer\")"); |
165 | QString errorMsg="Could not open audio device\n /dev/dsp\n" | 165 | QString errorMsg="Could not open audio device\n /dev/dsp\n" |
166 | +(QString)strerror(errno); | 166 | +(QString)strerror(errno); |
167 | qDebug("XXXXXXXXXXXXXXXXXXXXXX "+errorMsg); | 167 | odebug << "XXXXXXXXXXXXXXXXXXXXXX "+errorMsg << oendl; |
168 | } | 168 | } |
169 | 169 | ||
170 | if(ioctl(sd,SNDCTL_DSP_RESET,0)<0){ | 170 | if(ioctl(sd,SNDCTL_DSP_RESET,0)<0){ |
171 | perror("ioctl RESET"); | 171 | perror("ioctl RESET"); |
@@ -179,9 +179,9 @@ qDebug("Opening mixer"); | |||
179 | */ | 179 | */ |
180 | /* close(pipefd[0]); | 180 | /* close(pipefd[0]); |
181 | write(pipefd[1], message, sizeof(message)); | 181 | write(pipefd[1], message, sizeof(message)); |
182 | close(pipefd[1]); | 182 | close(pipefd[1]); |
183 | // qDebug("%d",soundDevice->sd ); | 183 | // odebug << "" << soundDevice->sd << "" << oendl; |
184 | _exit(0); | 184 | _exit(0); |
185 | } | 185 | } |
186 | default: | 186 | default: |
187 | // pid greater than zero is parent getting the child's pid | 187 | // pid greater than zero is parent getting the child's pid |
@@ -205,15 +205,15 @@ qDebug("Opening mixer"); | |||
205 | // } | 205 | // } |
206 | */ | 206 | */ |
207 | // bool ok; | 207 | // bool ok; |
208 | // sd = s.toInt(&ok, 10); | 208 | // sd = s.toInt(&ok, 10); |
209 | // qDebug("<<<<<<<<<<<<<>>>>>>>>>>>>"+s); | 209 | // odebug << "<<<<<<<<<<<<<>>>>>>>>>>>>"+s << oendl; |
210 | 210 | ||
211 | // f2.close(); | 211 | // f2.close(); |
212 | // } | 212 | // } |
213 | ::close(mixerHandle ); | 213 | ::close(mixerHandle ); |
214 | // qDebug("open device %s", dspstr); | 214 | // odebug << "open device " << dspstr << "" << oendl; |
215 | // qDebug("success! %d",sd); | 215 | // odebug << "success! " << sd << "" << oendl; |
216 | return sd; | 216 | return sd; |
217 | } | 217 | } |
218 | 218 | ||
219 | bool Device::closeDevice( bool) { | 219 | bool Device::closeDevice( bool) { |
@@ -229,14 +229,14 @@ bool Device::closeDevice( bool) { | |||
229 | 229 | ||
230 | ::close( sd); //close sound device | 230 | ::close( sd); //close sound device |
231 | // sdfd=0; | 231 | // sdfd=0; |
232 | // sd=0; | 232 | // sd=0; |
233 | // qDebug("closed dsp"); | 233 | // odebug << "closed dsp" << oendl; |
234 | return true; | 234 | return true; |
235 | } | 235 | } |
236 | 236 | ||
237 | bool Device::setDeviceFormat( int form) { | 237 | bool Device::setDeviceFormat( int form) { |
238 | qDebug("set device res %d %d", form, sd); | 238 | odebug << "set device res " << form << " " << sd << "" << oendl; |
239 | if (ioctl( sd, SNDCTL_DSP_SETFMT, &form)==-1) { //set format | 239 | if (ioctl( sd, SNDCTL_DSP_SETFMT, &form)==-1) { //set format |
240 | perror("ioctl(\"SNDCTL_DSP_SETFMT\")"); | 240 | perror("ioctl(\"SNDCTL_DSP_SETFMT\")"); |
241 | return false; | 241 | return false; |
242 | } | 242 | } |
@@ -244,9 +244,9 @@ bool Device::setDeviceFormat( int form) { | |||
244 | return true; | 244 | return true; |
245 | } | 245 | } |
246 | 246 | ||
247 | bool Device::setDeviceChannels( int ch) { | 247 | bool Device::setDeviceChannels( int ch) { |
248 | qDebug("set channels %d %d", ch, sd); | 248 | odebug << "set channels " << ch << " " << sd << "" << oendl; |
249 | if (ioctl( sd, SNDCTL_DSP_CHANNELS, &ch)==-1) { | 249 | if (ioctl( sd, SNDCTL_DSP_CHANNELS, &ch)==-1) { |
250 | perror("ioctl(\"SNDCTL_DSP_CHANNELS\")"); | 250 | perror("ioctl(\"SNDCTL_DSP_CHANNELS\")"); |
251 | return false; | 251 | return false; |
252 | } | 252 | } |
@@ -254,9 +254,9 @@ bool Device::setDeviceChannels( int ch) { | |||
254 | return true; | 254 | return true; |
255 | } | 255 | } |
256 | 256 | ||
257 | bool Device::setDeviceRate( int rate) { | 257 | bool Device::setDeviceRate( int rate) { |
258 | qDebug("set rate %d %d", rate, sd); | 258 | odebug << "set rate " << rate << " " << sd << "" << oendl; |
259 | if (ioctl( sd, SNDCTL_DSP_SPEED, &rate) == -1) { | 259 | if (ioctl( sd, SNDCTL_DSP_SPEED, &rate) == -1) { |
260 | perror("ioctl(\"SNDCTL_DSP_SPEED\")"); | 260 | perror("ioctl(\"SNDCTL_DSP_SPEED\")"); |
261 | return false; | 261 | return false; |
262 | } | 262 | } |
@@ -317,11 +317,11 @@ int Device::getDeviceChannels() { | |||
317 | int Device::getDeviceFragSize() { | 317 | int Device::getDeviceFragSize() { |
318 | int frag_size; | 318 | int frag_size; |
319 | 319 | ||
320 | if (ioctl( sd, SNDCTL_DSP_GETBLKSIZE, &frag_size) == -1) { | 320 | if (ioctl( sd, SNDCTL_DSP_GETBLKSIZE, &frag_size) == -1) { |
321 | qDebug("no fragsize"); | 321 | odebug << "no fragsize" << oendl; |
322 | } else { | 322 | } else { |
323 | qDebug("driver says frag size is %d", frag_size); | 323 | odebug << "driver says frag size is " << frag_size << "" << oendl; |
324 | } | 324 | } |
325 | return frag_size; | 325 | return frag_size; |
326 | } | 326 | } |
327 | 327 | ||
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 | |||
@@ -8,25 +8,30 @@ | |||
8 | ** | 8 | ** |
9 | *****************************************************************************/ | 9 | *****************************************************************************/ |
10 | 10 | ||
11 | #include "helpwindow.h" | 11 | #include "helpwindow.h" |
12 | #include <qlayout.h> | ||
13 | 12 | ||
14 | #include <qtoolbar.h> | 13 | /* OPIE */ |
14 | #include <opie2/odebug.h> | ||
15 | #include <qpe/resource.h> | 15 | #include <qpe/resource.h> |
16 | using namespace Opie::Core; | ||
16 | 17 | ||
18 | /* QT */ | ||
19 | #include <qlayout.h> | ||
20 | #include <qtoolbar.h> | ||
17 | #include <qaction.h> | 21 | #include <qaction.h> |
18 | #include <qmenubar.h> | 22 | #include <qmenubar.h> |
19 | 23 | ||
24 | /* STD */ | ||
20 | #include <ctype.h> | 25 | #include <ctype.h> |
21 | 26 | ||
22 | HelpWindow::HelpWindow( const QString& home_, const QString& _path, QWidget* parent, const char *name ) | 27 | HelpWindow::HelpWindow( const QString& home_, const QString& _path, QWidget* parent, const char *name ) |
23 | : QMainWindow( parent, name, WDestructiveClose ), pathCombo( 0 ), selectedURL() | 28 | : QMainWindow( parent, name, WDestructiveClose ), pathCombo( 0 ), selectedURL() |
24 | { | 29 | { |
25 | QGridLayout *layout = new QGridLayout( this ); | 30 | QGridLayout *layout = new QGridLayout( this ); |
26 | layout->setSpacing( 2); | 31 | layout->setSpacing( 2); |
27 | layout->setMargin( 2); | 32 | layout->setMargin( 2); |
28 | qDebug(_path); | 33 | odebug << _path << oendl; |
29 | browser = new QTextBrowser( this ); | 34 | browser = new QTextBrowser( this ); |
30 | QStringList Strlist; | 35 | QStringList Strlist; |
31 | Strlist.append( home_); | 36 | Strlist.append( home_); |
32 | browser->mimeSourceFactory()->setFilePath( Strlist ); | 37 | browser->mimeSourceFactory()->setFilePath( Strlist ); |
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,7 +1,5 @@ | |||
1 | #CONFIG = qt warn_on pdaudio | 1 | CONFIG = qt warn_on |
2 | CONFIG = qt warn_on opie | ||
3 | #CONFIG = qt warn_on quick-app | ||
4 | HEADERS = adpcm.h \ | 2 | HEADERS = adpcm.h \ |
5 | pixmaps.h \ | 3 | pixmaps.h \ |
6 | helpwindow.h \ | 4 | helpwindow.h \ |
7 | qtrec.h \ | 5 | qtrec.h \ |
@@ -28,9 +26,9 @@ contains(CONFIG, pdaudio) { | |||
28 | 26 | ||
29 | # DESTDIR=$(QPEDIR)/bin | 27 | # DESTDIR=$(QPEDIR)/bin |
30 | } | 28 | } |
31 | 29 | ||
32 | contains(CONFIG, opie) { | 30 | !contains(CONFIG, pdaudio) { |
33 | INCLUDEPATH += $(OPIEDIR)/include | 31 | INCLUDEPATH += $(OPIEDIR)/include |
34 | DEPENDPATH += $(OPIEDIR)/include | 32 | DEPENDPATH += $(OPIEDIR)/include |
35 | DESTDIR=$(OPIEDIR)/bin | 33 | DESTDIR=$(OPIEDIR)/bin |
36 | LIBS += -lqpe -lopiecore2 -lpthread | 34 | LIBS += -lqpe -lopiecore2 -lpthread |
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 | |||
@@ -7,26 +7,24 @@ | |||
7 | 7 | ||
8 | #include "pixmaps.h" | 8 | #include "pixmaps.h" |
9 | #include "qtrec.h" | 9 | #include "qtrec.h" |
10 | #include "waveform.h" | 10 | #include "waveform.h" |
11 | |||
12 | #include <pthread.h> | ||
13 | |||
14 | extern "C" { | 11 | extern "C" { |
15 | #include "adpcm.h" | 12 | #include "adpcm.h" |
16 | } | 13 | } |
17 | 14 | ||
18 | #include <sys/soundcard.h> | 15 | /* OPIE */ |
19 | 16 | #include <opie2/odebug.h> | |
20 | #include <qpe/config.h> | 17 | #include <qpe/config.h> |
21 | #include <qpe/qcopenvelope_qws.h> | 18 | #include <qpe/qcopenvelope_qws.h> |
22 | #include <qpe/qpeapplication.h> | 19 | #include <qpe/qpeapplication.h> |
23 | #include <qpe/resource.h> | 20 | #include <qpe/resource.h> |
24 | #include <qpe/storage.h> | 21 | #include <qpe/storage.h> |
22 | using namespace Opie::Core; | ||
25 | 23 | ||
24 | /* QT */ | ||
26 | #include <qcheckbox.h> | 25 | #include <qcheckbox.h> |
27 | #include <qcombobox.h> | 26 | #include <qcombobox.h> |
28 | //#include <qdatetime.h> | ||
29 | #include <qdir.h> | 27 | #include <qdir.h> |
30 | #include <qgroupbox.h> | 28 | #include <qgroupbox.h> |
31 | #include <qlabel.h> | 29 | #include <qlabel.h> |
32 | #include <qlayout.h> | 30 | #include <qlayout.h> |
@@ -37,8 +35,9 @@ extern "C" { | |||
37 | #include <qslider.h> | 35 | #include <qslider.h> |
38 | #include <qtabwidget.h> | 36 | #include <qtabwidget.h> |
39 | #include <qtimer.h> | 37 | #include <qtimer.h> |
40 | 38 | ||
39 | /* STD */ | ||
41 | #include <errno.h> | 40 | #include <errno.h> |
42 | #include <fcntl.h> | 41 | #include <fcntl.h> |
43 | #include <math.h> | 42 | #include <math.h> |
44 | #include <mntent.h> | 43 | #include <mntent.h> |
@@ -52,9 +51,9 @@ extern "C" { | |||
52 | #include <sys/vfs.h> | 51 | #include <sys/vfs.h> |
53 | #include <unistd.h> | 52 | #include <unistd.h> |
54 | #include <sys/wait.h> | 53 | #include <sys/wait.h> |
55 | #include <sys/signal.h> | 54 | #include <sys/signal.h> |
56 | 55 | #include <pthread.h> | |
57 | 56 | ||
58 | #ifdef PDAUDIO //ALSA | 57 | #ifdef PDAUDIO //ALSA |
59 | #include <alsa/asoundlib.h> | 58 | #include <alsa/asoundlib.h> |
60 | static int deviceSampleRates[8] = { 32000, 44100, 48000, 88200, 96000, 176400, 192000, -1 }; | 59 | static int deviceSampleRates[8] = { 32000, 44100, 48000, 88200, 96000, 176400, 192000, -1 }; |
@@ -135,19 +134,19 @@ void quickRec() | |||
135 | QString num; | 134 | QString num; |
136 | int level = 0; | 135 | int level = 0; |
137 | int threshold = 0; | 136 | int threshold = 0; |
138 | // int bits = filePara.resolution; | 137 | // int bits = filePara.resolution; |
139 | // qDebug("bits %d", bits); | 138 | // odebug << "bits " << bits << "" << oendl; |
140 | 139 | ||
141 | if( filePara.resolution == 16 ) { //AFMT_S16_LE) | 140 | if( filePara.resolution == 16 ) { //AFMT_S16_LE) |
142 | // qDebug("AFMT_S16_LE size %d", filePara.SecondsToRecord); | 141 | // odebug << "AFMT_S16_LE size " << filePara.SecondsToRecord << "" << oendl; |
143 | // qDebug("samples to record %d", filePara.samplesToRecord); | 142 | // odebug << "samples to record " << filePara.samplesToRecord << "" << oendl; |
144 | // qDebug("%d", filePara.sd); | 143 | // odebug << "" << filePara.sd << "" << oendl; |
145 | level = 7; | 144 | level = 7; |
146 | threshold = 0; | 145 | threshold = 0; |
147 | 146 | ||
148 | if( filePara.format == WAVE_FORMAT_DVI_ADPCM) { | 147 | if( filePara.format == WAVE_FORMAT_DVI_ADPCM) { |
149 | // qDebug("start recording WAVE_FORMAT_DVI_ADPCM"); | 148 | // odebug << "start recording WAVE_FORMAT_DVI_ADPCM" << oendl; |
150 | // <<<<<<<<<<<<<<<<<<<<<<<<<<< WAVE_FORMAT_DVI_ADPCM >>>>>>>>>>>>>>>>>>>>>> | 149 | // <<<<<<<<<<<<<<<<<<<<<<<<<<< WAVE_FORMAT_DVI_ADPCM >>>>>>>>>>>>>>>>>>>>>> |
151 | char abuf[ BUFSIZE/2 ]; | 150 | char abuf[ BUFSIZE/2 ]; |
152 | short sbuf[ BUFSIZE ]; | 151 | short sbuf[ BUFSIZE ]; |
153 | short sbuf2[ BUFSIZE ]; | 152 | short sbuf2[ BUFSIZE ]; |
@@ -156,18 +155,18 @@ void quickRec() | |||
156 | memset( sbuf2, 0, BUFSIZE); | 155 | memset( sbuf2, 0, BUFSIZE); |
157 | 156 | ||
158 | for(;;) { | 157 | for(;;) { |
159 | if ( stopped) { | 158 | if ( stopped) { |
160 | // qDebug("quickRec:: stopped"); | 159 | // odebug << "quickRec:: stopped" << oendl; |
161 | break; | 160 | break; |
162 | } | 161 | } |
163 | 162 | ||
164 | // number=::read( filePara.sd, sbuf, BUFSIZE); | 163 | // number=::read( filePara.sd, sbuf, BUFSIZE); |
165 | number = soundDevice ->devRead( filePara.sd, sbuf, BUFSIZE); | 164 | number = soundDevice ->devRead( filePara.sd, sbuf, BUFSIZE); |
166 | 165 | ||
167 | if(number <= 0) { | 166 | if(number <= 0) { |
168 | perror("recording error "); | 167 | perror("recording error "); |
169 | qDebug( "%s %d", filePara.fileName, number); | 168 | odebug << "" << filePara.fileName << " " << number << "" << oendl; |
170 | stopped = true; | 169 | stopped = true; |
171 | return; | 170 | return; |
172 | } | 171 | } |
173 | //if(stereo == 2) { | 172 | //if(stereo == 2) { |
@@ -191,16 +190,16 @@ void quickRec() | |||
191 | } | 190 | } |
192 | } | 191 | } |
193 | } else { | 192 | } else { |
194 | // <<<<<<<<<<<<<<<<<<<<<<<<<<< WAVE_FORMAT_PCM >>>>>>>>>>>>>>>>>>>>>> | 193 | // <<<<<<<<<<<<<<<<<<<<<<<<<<< WAVE_FORMAT_PCM >>>>>>>>>>>>>>>>>>>>>> |
195 | qDebug("start recording WAVE_FORMAT_PCM"); | 194 | odebug << "start recording WAVE_FORMAT_PCM" << oendl; |
196 | short inbuffer[ BUFSIZE ], outbuffer[ BUFSIZE ]; | 195 | short inbuffer[ BUFSIZE ], outbuffer[ BUFSIZE ]; |
197 | memset( inbuffer, 0, BUFSIZE); | 196 | memset( inbuffer, 0, BUFSIZE); |
198 | memset( outbuffer, 0, BUFSIZE); | 197 | memset( outbuffer, 0, BUFSIZE); |
199 | 198 | ||
200 | for(;;) { | 199 | for(;;) { |
201 | if ( stopped) { | 200 | if ( stopped) { |
202 | qDebug("quickRec:: stopped"); | 201 | odebug << "quickRec:: stopped" << oendl; |
203 | stopped = true; | 202 | stopped = true; |
204 | break; // stop if playing was set to false | 203 | break; // stop if playing was set to false |
205 | return; | 204 | return; |
206 | } | 205 | } |
@@ -209,9 +208,9 @@ void quickRec() | |||
209 | waveform->newSamples( inbuffer, number ); | 208 | waveform->newSamples( inbuffer, number ); |
210 | 209 | ||
211 | if( number <= 0) { | 210 | if( number <= 0) { |
212 | perror( "recording error "); | 211 | perror( "recording error "); |
213 | qDebug( filePara.fileName); | 212 | odebug << filePara.fileName << oendl; |
214 | stopped = true; | 213 | stopped = true; |
215 | return; | 214 | return; |
216 | } | 215 | } |
217 | 216 | ||
@@ -249,9 +248,9 @@ void quickRec() | |||
249 | memset( unsigned_outbuffer, 0, BUFSIZE); | 248 | memset( unsigned_outbuffer, 0, BUFSIZE); |
250 | 249 | ||
251 | for(;;) { | 250 | for(;;) { |
252 | if ( stopped) { | 251 | if ( stopped) { |
253 | qDebug("quickRec:: stopped"); | 252 | odebug << "quickRec:: stopped" << oendl; |
254 | break; // stop if playing was set to false | 253 | break; // stop if playing was set to false |
255 | } | 254 | } |
256 | 255 | ||
257 | number = ::read( filePara.sd, unsigned_inbuffer, BUFSIZE); | 256 | number = ::read( filePara.sd, unsigned_inbuffer, BUFSIZE); |
@@ -372,9 +371,9 @@ void playIt() | |||
372 | 371 | ||
373 | qApp->processEvents(); | 372 | qApp->processEvents(); |
374 | 373 | ||
375 | if( /*total >= filePara.numberSamples || */ bytesWritten == 0) { | 374 | if( /*total >= filePara.numberSamples || */ bytesWritten == 0) { |
376 | qWarning("Jane! Stop this crazy thing!"); | 375 | owarn << "Jane! Stop this crazy thing!" << oendl; |
377 | stopped = true; | 376 | stopped = true; |
378 | // playing = false; | 377 | // playing = false; |
379 | break; | 378 | break; |
380 | } | 379 | } |
@@ -717,9 +716,9 @@ void QtRec::initIconView() { | |||
717 | QString temp; | 716 | QString temp; |
718 | QPixmap image0( ( const char** ) image0_data ); | 717 | QPixmap image0( ( const char** ) image0_data ); |
719 | 718 | ||
720 | int nFiles = cfg.readNumEntry("NumberofFiles",0); | 719 | int nFiles = cfg.readNumEntry("NumberofFiles",0); |
721 | // qDebug("init number of files %d", nFiles); | 720 | // odebug << "init number of files " << nFiles << "" << oendl; |
722 | 721 | ||
723 | for(int i=1;i<= nFiles;i++) { | 722 | for(int i=1;i<= nFiles;i++) { |
724 | 723 | ||
725 | QListViewItem * item; | 724 | QListViewItem * item; |
@@ -859,9 +858,9 @@ void QtRec::initConfig() { | |||
859 | inMuteCheckBox->setChecked( cofg.readBoolEntry( "MicMute",0)); | 858 | inMuteCheckBox->setChecked( cofg.readBoolEntry( "MicMute",0)); |
860 | } | 859 | } |
861 | 860 | ||
862 | void QtRec::stop() { | 861 | void QtRec::stop() { |
863 | qWarning("STOP"); | 862 | owarn << "STOP" << oendl; |
864 | setRecordButton(false); | 863 | setRecordButton(false); |
865 | 864 | ||
866 | if( !recording) | 865 | if( !recording) |
867 | endPlaying(); | 866 | endPlaying(); |
@@ -921,22 +920,22 @@ bool QtRec::rec() { //record | |||
921 | // soundDevice->getDeviceRate(), | 920 | // soundDevice->getDeviceRate(), |
922 | // soundDevice->getDeviceChannels()); | 921 | // soundDevice->getDeviceChannels()); |
923 | 922 | ||
924 | //filePara.sampleRate = cfg.readNumEntry("samplerate", 22050); | 923 | //filePara.sampleRate = cfg.readNumEntry("samplerate", 22050); |
925 | // qDebug("sample rate is %d", filePara.sampleRate); | 924 | // odebug << "sample rate is " << filePara.sampleRate << "" << oendl; |
926 | filePara.SecondsToRecord = getCurrentSizeLimit(); | 925 | filePara.SecondsToRecord = getCurrentSizeLimit(); |
927 | 926 | ||
928 | // qDebug("size limit %d sec", filePara.SecondsToRecord); | 927 | // odebug << "size limit " << filePara.SecondsToRecord << " sec" << oendl; |
929 | int diskSize = checkDiskSpace( (const QString &) wavFile->trackName()); | 928 | int diskSize = checkDiskSpace( (const QString &) wavFile->trackName()); |
930 | 929 | ||
931 | if( filePara.SecondsToRecord == 0) { | 930 | if( filePara.SecondsToRecord == 0) { |
932 | fileSize = diskSize; | 931 | fileSize = diskSize; |
933 | } else if( filePara.format == WAVE_FORMAT_PCM) { | 932 | } else if( filePara.format == WAVE_FORMAT_PCM) { |
934 | // qDebug("WAVE_FORMAT_PCM"); | 933 | // odebug << "WAVE_FORMAT_PCM" << oendl; |
935 | fileSize = (filePara.SecondsToRecord ) * filePara.channels | 934 | fileSize = (filePara.SecondsToRecord ) * filePara.channels |
936 | * filePara.sampleRate * ( filePara.resolution / 8) + 1000; | 935 | * filePara.sampleRate * ( filePara.resolution / 8) + 1000; |
937 | } else { | 936 | } else { |
938 | // qDebug("WAVE_FORMAT_DVI_ADPCM"); | 937 | // odebug << "WAVE_FORMAT_DVI_ADPCM" << oendl; |
939 | fileSize = ((filePara.SecondsToRecord) * filePara.channels | 938 | fileSize = ((filePara.SecondsToRecord) * filePara.channels |
940 | * filePara.sampleRate * ( filePara.resolution / 8) ) / 4 + 250; | 939 | * filePara.sampleRate * ( filePara.resolution / 8) ) / 4 + 250; |
941 | } | 940 | } |
942 | 941 | ||
@@ -946,9 +945,9 @@ bool QtRec::rec() { //record | |||
946 | if( paused) { | 945 | if( paused) { |
947 | paused = false; | 946 | paused = false; |
948 | } | 947 | } |
949 | // else { | 948 | // else { |
950 | qDebug("Setting timeslider %d", filePara.samplesToRecord); | 949 | odebug << "Setting timeslider " << filePara.samplesToRecord << "" << oendl; |
951 | // if(fileSize != 0) | 950 | // if(fileSize != 0) |
952 | timeSlider->setRange(0, filePara.samplesToRecord); | 951 | timeSlider->setRange(0, filePara.samplesToRecord); |
953 | // } | 952 | // } |
954 | 953 | ||
@@ -965,9 +964,9 @@ bool QtRec::rec() { //record | |||
965 | #ifdef DEV_VERSION | 964 | #ifdef DEV_VERSION |
966 | setCaption( msg); | 965 | setCaption( msg); |
967 | #endif | 966 | #endif |
968 | filePara.fileName=currentFile.latin1(); | 967 | filePara.fileName=currentFile.latin1(); |
969 | qDebug("Start recording thread"); | 968 | odebug << "Start recording thread" << oendl; |
970 | stopped = false; | 969 | stopped = false; |
971 | 970 | ||
972 | #ifdef THREADED | 971 | #ifdef THREADED |
973 | pthread_t thread1; | 972 | pthread_t thread1; |
@@ -1009,15 +1008,15 @@ void QtRec::thisTab(QWidget* widg) { | |||
1009 | } | 1008 | } |
1010 | 1009 | ||
1011 | void QtRec::getOutVol( ) { | 1010 | void QtRec::getOutVol( ) { |
1012 | filePara.outVol = soundDevice->getOutVolume(); | 1011 | filePara.outVol = soundDevice->getOutVolume(); |
1013 | // qDebug("out vol %d", filePara.outVol); | 1012 | // odebug << "out vol " << filePara.outVol << "" << oendl; |
1014 | OutputSlider->setValue( -filePara.outVol); | 1013 | OutputSlider->setValue( -filePara.outVol); |
1015 | } | 1014 | } |
1016 | 1015 | ||
1017 | void QtRec::getInVol() { | 1016 | void QtRec::getInVol() { |
1018 | filePara.inVol = soundDevice->getInVolume(); | 1017 | filePara.inVol = soundDevice->getInVolume(); |
1019 | // qDebug("in vol %d", filePara.inVol); | 1018 | // odebug << "in vol " << filePara.inVol << "" << oendl; |
1020 | InputSlider->setValue( -filePara.inVol); | 1019 | InputSlider->setValue( -filePara.inVol); |
1021 | } | 1020 | } |
1022 | 1021 | ||
1023 | void QtRec::changedOutVolume() { | 1022 | void QtRec::changedOutVolume() { |
@@ -1089,13 +1088,13 @@ bool QtRec::setupAudio( bool b) { | |||
1089 | sampleformat = AFMT_U8; | 1088 | sampleformat = AFMT_U8; |
1090 | 1089 | ||
1091 | if( !compressionCheckBox->isChecked()) { | 1090 | if( !compressionCheckBox->isChecked()) { |
1092 | filePara.format = WAVE_FORMAT_PCM; | 1091 | filePara.format = WAVE_FORMAT_PCM; |
1093 | // qDebug("WAVE_FORMAT_PCM"); | 1092 | // odebug << "WAVE_FORMAT_PCM" << oendl; |
1094 | } else { | 1093 | } else { |
1095 | filePara.format = WAVE_FORMAT_DVI_ADPCM; | 1094 | filePara.format = WAVE_FORMAT_DVI_ADPCM; |
1096 | sampleformat = AFMT_S16_LE; | 1095 | sampleformat = AFMT_S16_LE; |
1097 | // qDebug("WAVE_FORMAT_DVI_ADPCM"); | 1096 | // odebug << "WAVE_FORMAT_DVI_ADPCM" << oendl; |
1098 | } | 1097 | } |
1099 | #endif | 1098 | #endif |
1100 | 1099 | ||
1101 | stereo = filePara.channels; | 1100 | stereo = filePara.channels; |
@@ -1109,17 +1108,17 @@ bool QtRec::setupAudio( bool b) { | |||
1109 | recording = true; | 1108 | recording = true; |
1110 | } | 1109 | } |
1111 | 1110 | ||
1112 | // if(soundDevice) delete soundDevice; | 1111 | // if(soundDevice) delete soundDevice; |
1113 | qDebug("<<<<<<<<<<<<<<<<<<<open dsp %d %d %d", filePara.sampleRate, filePara.channels, sampleformat); | 1112 | odebug << "<<<<<<<<<<<<<<<<<<<open dsp " << filePara.sampleRate << " " << filePara.channels << " " << sampleformat << "" << oendl; |
1114 | qWarning("change waveform settings"); | 1113 | owarn << "change waveform settings" << oendl; |
1115 | waveform->changeSettings( filePara.sampleRate, filePara.channels ); | 1114 | waveform->changeSettings( filePara.sampleRate, filePara.channels ); |
1116 | 1115 | ||
1117 | soundDevice = new Device( this, dspString, mixerString, b); | 1116 | soundDevice = new Device( this, dspString, mixerString, b); |
1118 | // soundDevice->openDsp(); | 1117 | // soundDevice->openDsp(); |
1119 | soundDevice->reset(); | 1118 | soundDevice->reset(); |
1120 | 1119 | ||
1121 | qDebug("device has been made %d", soundDevice->sd); | 1120 | odebug << "device has been made " << soundDevice->sd << "" << oendl; |
1122 | 1121 | ||
1123 | ////////////////// <<<<<<<<<<<<>>>>>>>>>>>> | 1122 | ////////////////// <<<<<<<<<<<<>>>>>>>>>>>> |
1124 | soundDevice->setDeviceFormat( sampleformat); | 1123 | soundDevice->setDeviceFormat( sampleformat); |
1125 | soundDevice->setDeviceChannels( filePara.channels); | 1124 | soundDevice->setDeviceChannels( filePara.channels); |
@@ -1148,9 +1147,9 @@ bool QtRec::setupAudio( bool b) { | |||
1148 | } | 1147 | } |
1149 | 1148 | ||
1150 | 1149 | ||
1151 | bool QtRec::setUpFile() { //setup file for recording | 1150 | bool QtRec::setUpFile() { //setup file for recording |
1152 | // qDebug("Setting up wavfile"); | 1151 | // odebug << "Setting up wavfile" << oendl; |
1153 | // if(wavFile) delete wavFile; | 1152 | // if(wavFile) delete wavFile; |
1154 | wavFile = new WavFile( this, (const QString &)"", | 1153 | wavFile = new WavFile( this, (const QString &)"", |
1155 | true, | 1154 | true, |
1156 | filePara.sampleRate, | 1155 | filePara.sampleRate, |
@@ -1181,9 +1180,9 @@ bool QtRec::doPlay() { | |||
1181 | stopped = false; | 1180 | stopped = false; |
1182 | recording = false; | 1181 | recording = false; |
1183 | 1182 | ||
1184 | QString num; | 1183 | QString num; |
1185 | qDebug( "Play number of samples %d", filePara.numberSamples); | 1184 | odebug << "Play number of samples " << filePara.numberSamples << "" << oendl; |
1186 | 1185 | ||
1187 | // timeSlider->setRange( 0, filePara.numberSamples); | 1186 | // timeSlider->setRange( 0, filePara.numberSamples); |
1188 | 1187 | ||
1189 | timeString.sprintf("%f", filePara.numberOfRecordedSeconds); | 1188 | timeString.sprintf("%f", filePara.numberOfRecordedSeconds); |
@@ -1233,9 +1232,9 @@ void QtRec::changesamplerateCombo(int i) { | |||
1233 | bool ok; | 1232 | bool ok; |
1234 | rate = sampleRateComboBox->text(i).toInt(&ok, 10); | 1233 | rate = sampleRateComboBox->text(i).toInt(&ok, 10); |
1235 | cfg.writeEntry( "samplerate",rate); | 1234 | cfg.writeEntry( "samplerate",rate); |
1236 | filePara.sampleRate=rate; | 1235 | filePara.sampleRate=rate; |
1237 | qDebug( "Change sample rate %d", rate); | 1236 | odebug << "Change sample rate " << rate << "" << oendl; |
1238 | cfg.write(); | 1237 | cfg.write(); |
1239 | } | 1238 | } |
1240 | 1239 | ||
1241 | 1240 | ||
@@ -1253,9 +1252,9 @@ void QtRec::changeDirCombo(int index) { | |||
1253 | (*it)->name() == sName ) { | 1252 | (*it)->name() == sName ) { |
1254 | const QString path = (*it)->path(); | 1253 | const QString path = (*it)->path(); |
1255 | recDir = path; | 1254 | recDir = path; |
1256 | cfg.writeEntry("directory", recDir); | 1255 | cfg.writeEntry("directory", recDir); |
1257 | qDebug("new rec dir "+recDir); | 1256 | odebug << "new rec dir "+recDir << oendl; |
1258 | } | 1257 | } |
1259 | } | 1258 | } |
1260 | cfg.write(); | 1259 | cfg.write(); |
1261 | } | 1260 | } |
@@ -1373,9 +1372,9 @@ void QtRec::keyPressEvent( QKeyEvent *e) { | |||
1373 | case Key_Down: | 1372 | case Key_Down: |
1374 | // newSound(); | 1373 | // newSound(); |
1375 | break; | 1374 | break; |
1376 | case Key_Left: { | 1375 | case Key_Left: { |
1377 | qDebug("rewinding"); | 1376 | odebug << "rewinding" << oendl; |
1378 | if( !e->isAutoRepeat()) | 1377 | if( !e->isAutoRepeat()) |
1379 | rewindPressed(); | 1378 | rewindPressed(); |
1380 | } | 1379 | } |
1381 | break; | 1380 | break; |
@@ -1427,21 +1426,21 @@ void QtRec::keyReleaseEvent( QKeyEvent *e) { | |||
1427 | deleteSound(); | 1426 | deleteSound(); |
1428 | break; | 1427 | break; |
1429 | case Key_Up: | 1428 | case Key_Up: |
1430 | // stop(); | 1429 | // stop(); |
1431 | qDebug("Up"); | 1430 | odebug << "Up" << oendl; |
1432 | break; | 1431 | break; |
1433 | case Key_Down: | 1432 | case Key_Down: |
1434 | // start(); | 1433 | // start(); |
1435 | // qDebug("Down"); | 1434 | // odebug << "Down" << oendl; |
1436 | // newSound(); | 1435 | // newSound(); |
1437 | break; | 1436 | break; |
1438 | case Key_Left: | 1437 | case Key_Left: |
1439 | qDebug("Left"); | 1438 | odebug << "Left" << oendl; |
1440 | rewindReleased(); | 1439 | rewindReleased(); |
1441 | break; | 1440 | break; |
1442 | case Key_Right: | 1441 | case Key_Right: |
1443 | qDebug("Right"); | 1442 | odebug << "Right" << oendl; |
1444 | FastforwardReleased(); | 1443 | FastforwardReleased(); |
1445 | break; | 1444 | break; |
1446 | } | 1445 | } |
1447 | } | 1446 | } |
@@ -1474,13 +1473,13 @@ void QtRec::endRecording() { | |||
1474 | if( wavFile->isTempFile()) { | 1473 | if( wavFile->isTempFile()) { |
1475 | // move tmp file to regular file | 1474 | // move tmp file to regular file |
1476 | QString cmd; | 1475 | QString cmd; |
1477 | cmd.sprintf("mv "+ wavFile->trackName() + " " + wavFile->currentFileName); | 1476 | cmd.sprintf("mv "+ wavFile->trackName() + " " + wavFile->currentFileName); |
1478 | // qDebug("moving tmp file to "+currentFileName); | 1477 | // odebug << "moving tmp file to "+currentFileName << oendl; |
1479 | system( cmd.latin1()); | 1478 | system( cmd.latin1()); |
1480 | } | 1479 | } |
1481 | 1480 | ||
1482 | qDebug("Just moved " + wavFile->currentFileName); | 1481 | odebug << "Just moved " + wavFile->currentFileName << oendl; |
1483 | Config cfg("OpieRec"); | 1482 | Config cfg("OpieRec"); |
1484 | cfg.setGroup("Sounds"); | 1483 | cfg.setGroup("Sounds"); |
1485 | 1484 | ||
1486 | int nFiles = cfg.readNumEntry( "NumberofFiles",0); | 1485 | int nFiles = cfg.readNumEntry( "NumberofFiles",0); |
@@ -1494,12 +1493,12 @@ void QtRec::endRecording() { | |||
1494 | 1493 | ||
1495 | QString time; | 1494 | QString time; |
1496 | time.sprintf("%.2f", filePara.numberOfRecordedSeconds); | 1495 | time.sprintf("%.2f", filePara.numberOfRecordedSeconds); |
1497 | cfg.writeEntry( wavFile->currentFileName, time ); | 1496 | cfg.writeEntry( wavFile->currentFileName, time ); |
1498 | // qDebug("writing config numberOfRecordedSeconds "+time); | 1497 | // odebug << "writing config numberOfRecordedSeconds "+time << oendl; |
1499 | 1498 | ||
1500 | cfg.write(); | 1499 | cfg.write(); |
1501 | qDebug("finished recording"); | 1500 | odebug << "finished recording" << oendl; |
1502 | timeLabel->setText(""); | 1501 | timeLabel->setText(""); |
1503 | } | 1502 | } |
1504 | 1503 | ||
1505 | if(soundDevice) delete soundDevice; | 1504 | if(soundDevice) delete soundDevice; |
@@ -1515,9 +1514,9 @@ void QtRec::endPlaying() { | |||
1515 | playing = false; | 1514 | playing = false; |
1516 | stopped = true; | 1515 | stopped = true; |
1517 | waveform->reset(); | 1516 | waveform->reset(); |
1518 | // errorStop(); | 1517 | // errorStop(); |
1519 | // qDebug("end playing"); | 1518 | // odebug << "end playing" << oendl; |
1520 | setRecordButton( false); | 1519 | setRecordButton( false); |
1521 | 1520 | ||
1522 | toBeginningButton->setEnabled( true); | 1521 | toBeginningButton->setEnabled( true); |
1523 | toEndButton->setEnabled( true); | 1522 | toEndButton->setEnabled( true); |
@@ -1527,20 +1526,20 @@ void QtRec::endPlaying() { | |||
1527 | 1526 | ||
1528 | soundDevice->closeDevice( false); | 1527 | soundDevice->closeDevice( false); |
1529 | soundDevice->sd = -1; | 1528 | soundDevice->sd = -1; |
1530 | // if(soundDevice) delete soundDevice; | 1529 | // if(soundDevice) delete soundDevice; |
1531 | // qDebug("file and sound device closed"); | 1530 | // odebug << "file and sound device closed" << oendl; |
1532 | timeLabel->setText(""); | 1531 | timeLabel->setText(""); |
1533 | total = 0; | 1532 | total = 0; |
1534 | filePara.numberSamples = 0; | 1533 | filePara.numberSamples = 0; |
1535 | filePara.sd = -1; | 1534 | filePara.sd = -1; |
1536 | // wavFile->closeFile(); | 1535 | // wavFile->closeFile(); |
1537 | filePara.fd = 0; | 1536 | filePara.fd = 0; |
1538 | // if(wavFile) delete wavFile; //this crashes | 1537 | // if(wavFile) delete wavFile; //this crashes |
1539 | 1538 | ||
1540 | // qDebug("track closed"); | 1539 | // odebug << "track closed" << oendl; |
1541 | killTimers(); | 1540 | killTimers(); |
1542 | qWarning("reset slider"); | 1541 | owarn << "reset slider" << oendl; |
1543 | timeSlider->setValue(0); | 1542 | timeSlider->setValue(0); |
1544 | 1543 | ||
1545 | if(soundDevice) delete soundDevice; | 1544 | if(soundDevice) delete soundDevice; |
1546 | 1545 | ||
@@ -1560,9 +1559,9 @@ bool QtRec::openPlayFile() { | |||
1560 | int nFiles = cfg.readNumEntry( "NumberofFiles", 0); | 1559 | int nFiles = cfg.readNumEntry( "NumberofFiles", 0); |
1561 | for(int i=0;i<nFiles+1;i++) { //look for file | 1560 | for(int i=0;i<nFiles+1;i++) { //look for file |
1562 | if( cfg.readEntry( QString::number(i),"").find( currentFile,0,true) != -1) { | 1561 | if( cfg.readEntry( QString::number(i),"").find( currentFile,0,true) != -1) { |
1563 | currentFileName = cfg.readEntry( currentFile, "" ); | 1562 | currentFileName = cfg.readEntry( currentFile, "" ); |
1564 | qDebug("opening for play: " + currentFileName); | 1563 | odebug << "opening for play: " + currentFileName << oendl; |
1565 | } | 1564 | } |
1566 | } | 1565 | } |
1567 | wavFile = new WavFile(this, | 1566 | wavFile = new WavFile(this, |
1568 | currentFileName, | 1567 | currentFileName, |
@@ -1585,12 +1584,12 @@ bool QtRec::openPlayFile() { | |||
1585 | filePara.channels = wavFile->getChannels(); | 1584 | filePara.channels = wavFile->getChannels(); |
1586 | timeSlider->setPageStep(1); | 1585 | timeSlider->setPageStep(1); |
1587 | monitoring = true; | 1586 | monitoring = true; |
1588 | 1587 | ||
1589 | qDebug("file %d, samples %d %d", filePara.fd, filePara.numberSamples, filePara.sampleRate); | 1588 | odebug << "file " << filePara.fd << ", samples " << filePara.numberSamples << " " << filePara.sampleRate << "" << oendl; |
1590 | int sec = (int) (( filePara.numberSamples / filePara.sampleRate) / filePara.channels) / ( filePara.channels*( filePara.resolution/8)); | 1589 | int sec = (int) (( filePara.numberSamples / filePara.sampleRate) / filePara.channels) / ( filePara.channels*( filePara.resolution/8)); |
1591 | 1590 | ||
1592 | qWarning("seconds %d", sec); | 1591 | owarn << "seconds " << sec << "" << oendl; |
1593 | 1592 | ||
1594 | timeSlider->setRange(0, filePara.numberSamples ); | 1593 | timeSlider->setRange(0, filePara.numberSamples ); |
1595 | } | 1594 | } |
1596 | 1595 | ||
@@ -1689,9 +1688,9 @@ void QtRec::doRename() { | |||
1689 | 1688 | ||
1690 | } | 1689 | } |
1691 | 1690 | ||
1692 | void QtRec::okRename() { | 1691 | void QtRec::okRename() { |
1693 | qDebug(renameBox->text()); | 1692 | odebug << renameBox->text() << oendl; |
1694 | QString filename = renameBox->text(); | 1693 | QString filename = renameBox->text(); |
1695 | cancelRename(); | 1694 | cancelRename(); |
1696 | 1695 | ||
1697 | if( ListView1->currentItem() == NULL) | 1696 | if( ListView1->currentItem() == NULL) |
@@ -1701,9 +1700,9 @@ void QtRec::okRename() { | |||
1701 | cfg.setGroup("Sounds"); | 1700 | cfg.setGroup("Sounds"); |
1702 | 1701 | ||
1703 | QString file = ListView1->currentItem()->text(0); | 1702 | QString file = ListView1->currentItem()->text(0); |
1704 | 1703 | ||
1705 | qDebug("filename is " + filename); | 1704 | odebug << "filename is " + filename << oendl; |
1706 | 1705 | ||
1707 | int nFiles = cfg.readNumEntry("NumberofFiles",0); | 1706 | int nFiles = cfg.readNumEntry("NumberofFiles",0); |
1708 | 1707 | ||
1709 | for(int i=0;i<nFiles+1;i++) { //look for file | 1708 | for(int i=0;i<nFiles+1;i++) { //look for file |
@@ -1772,9 +1771,9 @@ void QtRec::doVolMuting(bool b) { | |||
1772 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << b; | 1771 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << b; |
1773 | } | 1772 | } |
1774 | 1773 | ||
1775 | void QtRec::doMicMuting(bool b) { | 1774 | void QtRec::doMicMuting(bool b) { |
1776 | // qDebug("mic mute"); | 1775 | // odebug << "mic mute" << oendl; |
1777 | Config cfg( "qpe" ); | 1776 | Config cfg( "qpe" ); |
1778 | cfg. setGroup( "Volume" ); | 1777 | cfg. setGroup( "Volume" ); |
1779 | cfg.writeEntry( "MicMute",b); | 1778 | cfg.writeEntry( "MicMute",b); |
1780 | cfg.write(); | 1779 | cfg.write(); |
@@ -1828,9 +1827,9 @@ long QtRec::checkDiskSpace(const QString &path) { | |||
1828 | // char f_fname[6]; /* Volumename */ | 1827 | // char f_fname[6]; /* Volumename */ |
1829 | // char f_fpack[6]; /* Pack name */ | 1828 | // char f_fpack[6]; /* Pack name */ |
1830 | 1829 | ||
1831 | void QtRec::receive( const QCString &msg, const QByteArray & ) { | 1830 | void QtRec::receive( const QCString &msg, const QByteArray & ) { |
1832 | qDebug("Voicerecord received message "+msg); | 1831 | odebug << "Voicerecord received message "+msg << oendl; |
1833 | 1832 | ||
1834 | } | 1833 | } |
1835 | 1834 | ||
1836 | 1835 | ||
@@ -1853,9 +1852,9 @@ void QtRec::timerEvent( QTimerEvent * ) { | |||
1853 | if( recording && filePara.SecondsToRecord < secCount && filePara.SecondsToRecord != 0) { | 1852 | if( recording && filePara.SecondsToRecord < secCount && filePara.SecondsToRecord != 0) { |
1854 | stop(); | 1853 | stop(); |
1855 | } | 1854 | } |
1856 | 1855 | ||
1857 | qDebug( "%d", secCount ); | 1856 | odebug << "" << secCount << "" << oendl; |
1858 | QString timeString; | 1857 | QString timeString; |
1859 | #ifdef DEV_VERSION | 1858 | #ifdef DEV_VERSION |
1860 | QString msg; | 1859 | QString msg; |
1861 | msg.sprintf("%d, %d, %d", filePara.sampleRate, filePara.channels, filePara.resolution); | 1860 | msg.sprintf("%d, %d, %d", filePara.sampleRate, filePara.channels, filePara.resolution); |
@@ -1869,9 +1868,9 @@ void QtRec::timerEvent( QTimerEvent * ) { | |||
1869 | } | 1868 | } |
1870 | 1869 | ||
1871 | void QtRec::changeTimeSlider(int index) { | 1870 | void QtRec::changeTimeSlider(int index) { |
1872 | if( ListView1->currentItem() == 0 || !wavFile->track.isOpen()) return; | 1871 | if( ListView1->currentItem() == 0 || !wavFile->track.isOpen()) return; |
1873 | // qDebug("Slider moved to %d",index); | 1872 | // odebug << "Slider moved to " << index << "" << oendl; |
1874 | paused = true; | 1873 | paused = true; |
1875 | stopped = true; | 1874 | stopped = true; |
1876 | 1875 | ||
1877 | sliderPos=index; | 1876 | sliderPos=index; |
@@ -1884,18 +1883,18 @@ void QtRec::changeTimeSlider(int index) { | |||
1884 | } | 1883 | } |
1885 | 1884 | ||
1886 | void QtRec::timeSliderPressed() { | 1885 | void QtRec::timeSliderPressed() { |
1887 | if( ListView1->currentItem() == 0) return; | 1886 | if( ListView1->currentItem() == 0) return; |
1888 | // qDebug("slider pressed"); | 1887 | // odebug << "slider pressed" << oendl; |
1889 | paused = true; | 1888 | paused = true; |
1890 | stopped = true; | 1889 | stopped = true; |
1891 | } | 1890 | } |
1892 | 1891 | ||
1893 | void QtRec::timeSliderReleased() { | 1892 | void QtRec::timeSliderReleased() { |
1894 | if( ListView1->currentItem() == 0) return; | 1893 | if( ListView1->currentItem() == 0) return; |
1895 | sliderPos = timeSlider->value(); | 1894 | sliderPos = timeSlider->value(); |
1896 | 1895 | ||
1897 | // qDebug("slider released %d", sliderPos); | 1896 | // odebug << "slider released " << sliderPos << "" << oendl; |
1898 | stopped = false; | 1897 | stopped = false; |
1899 | int newPos = lseek( filePara.fd, sliderPos, SEEK_SET); | 1898 | int newPos = lseek( filePara.fd, sliderPos, SEEK_SET); |
1900 | total = newPos*4; | 1899 | total = newPos*4; |
1901 | filePara.numberOfRecordedSeconds = (float)sliderPos / (float)filePara.sampleRate * (float)2; | 1900 | filePara.numberOfRecordedSeconds = (float)sliderPos / (float)filePara.sampleRate * (float)2; |
@@ -1923,9 +1922,9 @@ void QtRec::rewindTimerTimeout() { | |||
1923 | int sliderValue = timeSlider->value(); | 1922 | int sliderValue = timeSlider->value(); |
1924 | sliderValue = sliderValue - ( filePara.numberSamples / 100); | 1923 | sliderValue = sliderValue - ( filePara.numberSamples / 100); |
1925 | // if(toBeginningButton->isDown()) | 1924 | // if(toBeginningButton->isDown()) |
1926 | timeSlider->setValue( sliderValue ) ; | 1925 | timeSlider->setValue( sliderValue ) ; |
1927 | // qDebug("%d", sliderValue); | 1926 | // odebug << "" << sliderValue << "" << oendl; |
1928 | QString timeString; | 1927 | QString timeString; |
1929 | filePara.numberOfRecordedSeconds = (float)sliderValue / (float)filePara.sampleRate * (float)2; | 1928 | filePara.numberOfRecordedSeconds = (float)sliderValue / (float)filePara.sampleRate * (float)2; |
1930 | timeString.sprintf( "%.2f", filePara.numberOfRecordedSeconds); | 1929 | timeString.sprintf( "%.2f", filePara.numberOfRecordedSeconds); |
1931 | timeLabel->setText( timeString+ tr(" seconds")); | 1930 | timeLabel->setText( timeString+ tr(" seconds")); |
@@ -1937,9 +1936,9 @@ void QtRec::rewindReleased() { | |||
1937 | sliderPos=timeSlider->value(); | 1936 | sliderPos=timeSlider->value(); |
1938 | stopped = false; | 1937 | stopped = false; |
1939 | int newPos = lseek( filePara.fd, sliderPos, SEEK_SET); | 1938 | int newPos = lseek( filePara.fd, sliderPos, SEEK_SET); |
1940 | total = newPos * 4; | 1939 | total = newPos * 4; |
1941 | // qDebug("rewind released %d", total); | 1940 | // odebug << "rewind released " << total << "" << oendl; |
1942 | startTimer( 1000); | 1941 | startTimer( 1000); |
1943 | doPlay(); | 1942 | doPlay(); |
1944 | } | 1943 | } |
1945 | } | 1944 | } |
@@ -2001,9 +2000,9 @@ QString QtRec::getStorage(const QString &fileName) { | |||
2001 | storage = name; | 2000 | storage = name; |
2002 | // const QString options = (*it)->options(); | 2001 | // const QString options = (*it)->options(); |
2003 | // if( name.find( tr("Internal"),0,true) == -1) { | 2002 | // if( name.find( tr("Internal"),0,true) == -1) { |
2004 | // storageComboBox->insertItem( name +" -> "+disk); | 2003 | // storageComboBox->insertItem( name +" -> "+disk); |
2005 | // qDebug(name); | 2004 | // odebug << name << oendl; |
2006 | } | 2005 | } |
2007 | return storage; | 2006 | return storage; |
2008 | // struct mntent *me; | 2007 | // struct mntent *me; |
2009 | // // if(fileName == "/etc/mtab") { | 2008 | // // if(fileName == "/etc/mtab") { |
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 | |||
@@ -1,19 +1,22 @@ | |||
1 | //wavFile.cpp | 1 | //wavFile.cpp |
2 | #include "wavFile.h" | 2 | #include "wavFile.h" |
3 | #include "qtrec.h" | 3 | #include "qtrec.h" |
4 | 4 | ||
5 | /* OPIE */ | ||
6 | #include <opie2/odebug.h> | ||
7 | #include <qpe/config.h> | ||
8 | using namespace Opie::Core; | ||
9 | |||
10 | /* QT */ | ||
5 | #include <qmessagebox.h> | 11 | #include <qmessagebox.h> |
6 | #include <qdir.h> | 12 | #include <qdir.h> |
7 | 13 | ||
8 | #include <qpe/config.h> | 14 | /* STD */ |
9 | |||
10 | #include <errno.h> | 15 | #include <errno.h> |
11 | |||
12 | #include <sys/time.h> | 16 | #include <sys/time.h> |
13 | #include <sys/types.h> | 17 | #include <sys/types.h> |
14 | #include <sys/vfs.h> | 18 | #include <sys/vfs.h> |
15 | |||
16 | #include <fcntl.h> | 19 | #include <fcntl.h> |
17 | #include <math.h> | 20 | #include <math.h> |
18 | #include <mntent.h> | 21 | #include <mntent.h> |
19 | #include <stdio.h> | 22 | #include <stdio.h> |
@@ -23,9 +26,9 @@ | |||
23 | WavFile::WavFile( QObject * parent,const QString &fileName, bool makeNwFile, int sampleRate, | 26 | WavFile::WavFile( QObject * parent,const QString &fileName, bool makeNwFile, int sampleRate, |
24 | int channels, int resolution, int format ) | 27 | int channels, int resolution, int format ) |
25 | : QObject( parent) | 28 | : QObject( parent) |
26 | { | 29 | { |
27 | //qDebug("new wave file"); | 30 | //odebug << "new wave file" << oendl; |
28 | bool b = makeNwFile; | 31 | bool b = makeNwFile; |
29 | wavSampleRate=sampleRate; | 32 | wavSampleRate=sampleRate; |
30 | wavFormat=format; | 33 | wavFormat=format; |
31 | wavChannels=channels; | 34 | wavChannels=channels; |
@@ -39,9 +42,9 @@ WavFile::WavFile( QObject * parent,const QString &fileName, bool makeNwFile, int | |||
39 | } | 42 | } |
40 | 43 | ||
41 | bool WavFile::newFile() { | 44 | bool WavFile::newFile() { |
42 | 45 | ||
43 | // qDebug("Set up new file"); | 46 | // odebug << "Set up new file" << oendl; |
44 | Config cfg("OpieRec"); | 47 | Config cfg("OpieRec"); |
45 | cfg.setGroup("Settings"); | 48 | cfg.setGroup("Settings"); |
46 | 49 | ||
47 | currentFileName=cfg.readEntry("directory",QDir::homeDirPath()); | 50 | currentFileName=cfg.readEntry("directory",QDir::homeDirPath()); |
@@ -59,9 +62,9 @@ bool WavFile::newFile() { | |||
59 | else | 62 | else |
60 | currentFileName += date; | 63 | currentFileName += date; |
61 | currentFileName+=".wav"; | 64 | currentFileName+=".wav"; |
62 | 65 | ||
63 | // qDebug("set up file for recording: "+currentFileName); | 66 | // odebug << "set up file for recording: "+currentFileName << oendl; |
64 | char pointer[] = "/tmp/opierec-XXXXXX"; | 67 | char pointer[] = "/tmp/opierec-XXXXXX"; |
65 | int fd = 0; | 68 | int fd = 0; |
66 | 69 | ||
67 | if( currentFileName.find("/mnt",0,true) == -1 | 70 | if( currentFileName.find("/mnt",0,true) == -1 |
@@ -74,9 +77,9 @@ bool WavFile::newFile() { | |||
74 | perror("mkstemp failed"); | 77 | perror("mkstemp failed"); |
75 | return false; | 78 | return false; |
76 | } | 79 | } |
77 | 80 | ||
78 | // qDebug("Opening tmp file %s",pointer); | 81 | // odebug << "Opening tmp file " << pointer << "" << oendl; |
79 | track.setName( pointer); | 82 | track.setName( pointer); |
80 | 83 | ||
81 | } else { //just use regular file.. no moving | 84 | } else { //just use regular file.. no moving |
82 | 85 | ||
@@ -84,9 +87,9 @@ bool WavFile::newFile() { | |||
84 | track.setName( currentFileName); | 87 | track.setName( currentFileName); |
85 | } | 88 | } |
86 | if(!track.open( IO_ReadWrite | IO_Truncate)) { | 89 | if(!track.open( IO_ReadWrite | IO_Truncate)) { |
87 | QString errorMsg=(QString)strerror(errno); | 90 | QString errorMsg=(QString)strerror(errno); |
88 | qDebug(errorMsg); | 91 | odebug << errorMsg << oendl; |
89 | QMessageBox::message("Note", "Error opening file.\n" +errorMsg); | 92 | QMessageBox::message("Note", "Error opening file.\n" +errorMsg); |
90 | 93 | ||
91 | return false; | 94 | return false; |
92 | } else { | 95 | } else { |
@@ -105,16 +108,16 @@ void WavFile::closeFile() { | |||
105 | track.close(); | 108 | track.close(); |
106 | } | 109 | } |
107 | 110 | ||
108 | int WavFile::openFile(const QString ¤tFileName) { | 111 | int WavFile::openFile(const QString ¤tFileName) { |
109 | // qDebug("open play file "+currentFileName); | 112 | // odebug << "open play file "+currentFileName << oendl; |
110 | closeFile(); | 113 | closeFile(); |
111 | 114 | ||
112 | track.setName(currentFileName); | 115 | track.setName(currentFileName); |
113 | 116 | ||
114 | if(!track.open(IO_ReadOnly)) { | 117 | if(!track.open(IO_ReadOnly)) { |
115 | QString errorMsg=(QString)strerror(errno); | 118 | QString errorMsg=(QString)strerror(errno); |
116 | qDebug("<<<<<<<<<<< "+errorMsg+currentFileName); | 119 | odebug << "<<<<<<<<<<< "+errorMsg+currentFileName << oendl; |
117 | QMessageBox::message("Note", "Error opening file.\n" +errorMsg); | 120 | QMessageBox::message("Note", "Error opening file.\n" +errorMsg); |
118 | return -1; | 121 | return -1; |
119 | } else { | 122 | } else { |
120 | parseWavHeader( track.handle()); | 123 | parseWavHeader( track.handle()); |
@@ -130,13 +133,13 @@ bool WavFile::setWavHeader(int fd, wavhdr *hdr) { | |||
130 | (*hdr).fmtLen = 16; // format length = 16 | 133 | (*hdr).fmtLen = 16; // format length = 16 |
131 | 134 | ||
132 | if( wavFormat == WAVE_FORMAT_PCM) { | 135 | if( wavFormat == WAVE_FORMAT_PCM) { |
133 | (*hdr).fmtTag = 1; // PCM | 136 | (*hdr).fmtTag = 1; // PCM |
134 | // qDebug("set header WAVE_FORMAT_PCM"); | 137 | // odebug << "set header WAVE_FORMAT_PCM" << oendl; |
135 | } | 138 | } |
136 | else { | 139 | else { |
137 | (*hdr).fmtTag = WAVE_FORMAT_DVI_ADPCM; //intel ADPCM | 140 | (*hdr).fmtTag = WAVE_FORMAT_DVI_ADPCM; //intel ADPCM |
138 | // qDebug("set header WAVE_FORMAT_DVI_ADPCM"); | 141 | // odebug << "set header WAVE_FORMAT_DVI_ADPCM" << oendl; |
139 | } | 142 | } |
140 | 143 | ||
141 | // (*hdr).nChannels = 1;//filePara.channels;// ? 2 : 1*/; // channels | 144 | // (*hdr).nChannels = 1;//filePara.channels;// ? 2 : 1*/; // channels |
142 | (*hdr).nChannels = wavChannels;// ? 2 : 1*/; // channels | 145 | (*hdr).nChannels = wavChannels;// ? 2 : 1*/; // channels |
@@ -159,54 +162,54 @@ bool WavFile::adjustHeaders(int fd, int total) { | |||
159 | int i = total + 36; | 162 | int i = total + 36; |
160 | write( fd, &i, sizeof(i)); | 163 | write( fd, &i, sizeof(i)); |
161 | lseek( fd, 40, SEEK_SET); | 164 | lseek( fd, 40, SEEK_SET); |
162 | write( fd, &total, sizeof(total)); | 165 | write( fd, &total, sizeof(total)); |
163 | qDebug("adjusting header %d", total); | 166 | odebug << "adjusting header " << total << "" << oendl; |
164 | return true; | 167 | return true; |
165 | } | 168 | } |
166 | 169 | ||
167 | int WavFile::parseWavHeader(int fd) { | 170 | int WavFile::parseWavHeader(int fd) { |
168 | qDebug("Parsing wav header"); | 171 | odebug << "Parsing wav header" << oendl; |
169 | char string[4]; | 172 | char string[4]; |
170 | int found; | 173 | int found; |
171 | short fmt; | 174 | short fmt; |
172 | unsigned short ch, bitrate; | 175 | unsigned short ch, bitrate; |
173 | unsigned long samplerrate, longdata; | 176 | unsigned long samplerrate, longdata; |
174 | 177 | ||
175 | if (read(fd, string, 4) < 4) { | 178 | if (read(fd, string, 4) < 4) { |
176 | qDebug(" Could not read from sound file.\n"); | 179 | odebug << " Could not read from sound file.\n" << oendl; |
177 | return -1; | 180 | return -1; |
178 | } | 181 | } |
179 | if (strncmp(string, "RIFF", 4)) { | 182 | if (strncmp(string, "RIFF", 4)) { |
180 | qDebug(" not a valid WAV file.\n"); | 183 | odebug << " not a valid WAV file.\n" << oendl; |
181 | return -1; | 184 | return -1; |
182 | } | 185 | } |
183 | lseek(fd, 4, SEEK_CUR); | 186 | lseek(fd, 4, SEEK_CUR); |
184 | if (read(fd, string, 4) < 4) { | 187 | if (read(fd, string, 4) < 4) { |
185 | qDebug("Could not read from sound file.\n"); | 188 | odebug << "Could not read from sound file.\n" << oendl; |
186 | return -1; | 189 | return -1; |
187 | } | 190 | } |
188 | if (strncmp(string, "WAVE", 4)) { | 191 | if (strncmp(string, "WAVE", 4)) { |
189 | qDebug("not a valid WAV file.\n"); | 192 | odebug << "not a valid WAV file.\n" << oendl; |
190 | return -1; | 193 | return -1; |
191 | } | 194 | } |
192 | found = 0; | 195 | found = 0; |
193 | 196 | ||
194 | while (!found) { | 197 | while (!found) { |
195 | if (read(fd, string, 4) < 4) { | 198 | if (read(fd, string, 4) < 4) { |
196 | qDebug("Could not read from sound file.\n"); | 199 | odebug << "Could not read from sound file.\n" << oendl; |
197 | return -1; | 200 | return -1; |
198 | } | 201 | } |
199 | if (strncmp(string, "fmt ", 4)) { | 202 | if (strncmp(string, "fmt ", 4)) { |
200 | if (read(fd, &longdata, 4) < 4) { | 203 | if (read(fd, &longdata, 4) < 4) { |
201 | qDebug("Could not read from sound file.\n"); | 204 | odebug << "Could not read from sound file.\n" << oendl; |
202 | return -1; | 205 | return -1; |
203 | } | 206 | } |
204 | lseek(fd, longdata, SEEK_CUR); | 207 | lseek(fd, longdata, SEEK_CUR); |
205 | } else { | 208 | } else { |
206 | lseek(fd, 4, SEEK_CUR); | 209 | lseek(fd, 4, SEEK_CUR); |
207 | if (read(fd, &fmt, 2) < 2) { | 210 | if (read(fd, &fmt, 2) < 2) { |
208 | qDebug("Could not read format chunk.\n"); | 211 | odebug << "Could not read format chunk.\n" << oendl; |
209 | return -1; | 212 | return -1; |
210 | } | 213 | } |
211 | if (fmt != WAVE_FORMAT_PCM && fmt != WAVE_FORMAT_DVI_ADPCM) { | 214 | if (fmt != WAVE_FORMAT_PCM && fmt != WAVE_FORMAT_DVI_ADPCM) { |
212 | qDebug("Wave file contains unknown format." | 215 | qDebug("Wave file contains unknown format." |
@@ -214,53 +217,53 @@ int WavFile::parseWavHeader(int fd) { | |||
214 | return -1; | 217 | return -1; |
215 | } | 218 | } |
216 | wavFormat = fmt; | 219 | wavFormat = fmt; |
217 | // compressionFormat=fmt; | 220 | // compressionFormat=fmt; |
218 | qDebug("compressionFormat is %d", fmt); | 221 | odebug << "compressionFormat is " << fmt << "" << oendl; |
219 | if (read(fd, &ch, 2) < 2) { | 222 | if (read(fd, &ch, 2) < 2) { |
220 | qDebug("Could not read format chunk.\n"); | 223 | odebug << "Could not read format chunk.\n" << oendl; |
221 | return -1; | 224 | return -1; |
222 | } else { | 225 | } else { |
223 | wavChannels = ch; | 226 | wavChannels = ch; |
224 | qDebug("File has %d channels", ch); | 227 | odebug << "File has " << ch << " channels" << oendl; |
225 | } | 228 | } |
226 | if (read(fd, &samplerrate, 4) < 4) { | 229 | if (read(fd, &samplerrate, 4) < 4) { |
227 | qDebug("Could not read from format chunk.\n"); | 230 | odebug << "Could not read from format chunk.\n" << oendl; |
228 | return -1; | 231 | return -1; |
229 | } else { | 232 | } else { |
230 | wavSampleRate = samplerrate; | 233 | wavSampleRate = samplerrate; |
231 | // sampleRate = samplerrate; | 234 | // sampleRate = samplerrate; |
232 | qDebug("File has samplerate of %d",(int) samplerrate); | 235 | odebug << "File has samplerate of " << (int) samplerrate << "" << oendl; |
233 | } | 236 | } |
234 | lseek(fd, 6, SEEK_CUR); | 237 | lseek(fd, 6, SEEK_CUR); |
235 | if (read(fd, &bitrate, 2) < 2) { | 238 | if (read(fd, &bitrate, 2) < 2) { |
236 | qDebug("Could not read format chunk.\n"); | 239 | odebug << "Could not read format chunk.\n" << oendl; |
237 | return -1; | 240 | return -1; |
238 | } else { | 241 | } else { |
239 | wavResolution=bitrate; | 242 | wavResolution=bitrate; |
240 | // resolution = bitrate; | 243 | // resolution = bitrate; |
241 | qDebug("File has bitrate of %d", bitrate); | 244 | odebug << "File has bitrate of " << bitrate << "" << oendl; |
242 | } | 245 | } |
243 | found++; | 246 | found++; |
244 | } | 247 | } |
245 | } | 248 | } |
246 | found = 0; | 249 | found = 0; |
247 | while (!found) { | 250 | while (!found) { |
248 | if (read(fd, string, 4) < 4) { | 251 | if (read(fd, string, 4) < 4) { |
249 | qDebug("Could not read from sound file.\n"); | 252 | odebug << "Could not read from sound file.\n" << oendl; |
250 | return -1; | 253 | return -1; |
251 | } | 254 | } |
252 | 255 | ||
253 | if (strncmp(string, "data", 4)) { | 256 | if (strncmp(string, "data", 4)) { |
254 | if (read(fd, &longdata, 4)<4) { | 257 | if (read(fd, &longdata, 4)<4) { |
255 | qDebug("Could not read from sound file.\n"); | 258 | odebug << "Could not read from sound file.\n" << oendl; |
256 | return -1; | 259 | return -1; |
257 | } | 260 | } |
258 | 261 | ||
259 | lseek(fd, longdata, SEEK_CUR); | 262 | lseek(fd, longdata, SEEK_CUR); |
260 | } else { | 263 | } else { |
261 | if (read(fd, &longdata, 4) < 4) { | 264 | if (read(fd, &longdata, 4) < 4) { |
262 | qDebug("Could not read from sound file.\n"); | 265 | odebug << "Could not read from sound file.\n" << oendl; |
263 | return -1; | 266 | return -1; |
264 | } else { | 267 | } else { |
265 | wavNumberSamples = longdata; | 268 | wavNumberSamples = longdata; |
266 | qDebug("file has length of %d \nlasting %d seconds", (int)longdata, | 269 | qDebug("file has length of %d \nlasting %d seconds", (int)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 | |||
@@ -18,10 +18,14 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include "waveform.h" | 20 | #include "waveform.h" |
21 | 21 | ||
22 | #include <qpainter.h> | 22 | /* OPIE */ |
23 | #include <opie2/odebug.h> | ||
24 | using namespace Opie::Core; | ||
23 | 25 | ||
26 | /* QT */ | ||
27 | #include <qpainter.h> | ||
24 | 28 | ||
25 | Waveform::Waveform( QWidget *parent, const char *name, WFlags fl ) | 29 | Waveform::Waveform( QWidget *parent, const char *name, WFlags fl ) |
26 | : QWidget( parent, name, fl ) | 30 | : QWidget( parent, name, fl ) |
27 | { | 31 | { |
@@ -37,11 +41,11 @@ Waveform::Waveform( QWidget *parent, const char *name, WFlags fl ) | |||
37 | 41 | ||
38 | void Waveform::changeSettings( int frequency, int channels ) | 42 | void Waveform::changeSettings( int frequency, int channels ) |
39 | { | 43 | { |
40 | makePixmap(); | 44 | makePixmap(); |
41 | // qWarning("change waveform %d, %d", frequency, channels); | 45 | // owarn << "change waveform " << frequency << ", " << channels << "" << oendl; |
42 | samplesPerPixel = frequency * channels / (5 * windowSize); | 46 | samplesPerPixel = frequency * channels / (5 * windowSize); |
43 | qWarning("Waveform::changeSettings %d", samplesPerPixel); | 47 | owarn << "Waveform::changeSettings " << samplesPerPixel << "" << oendl; |
44 | if ( !samplesPerPixel ) | 48 | if ( !samplesPerPixel ) |
45 | samplesPerPixel = 1; | 49 | samplesPerPixel = 1; |
46 | currentValue = 0; | 50 | currentValue = 0; |
47 | numSamples = 0; | 51 | numSamples = 0; |
@@ -95,9 +99,9 @@ void Waveform::newSamples( const short *buf, int len ) | |||
95 | } | 99 | } |
96 | } | 100 | } |
97 | 101 | ||
98 | // Copy the final state back to the object. | 102 | // Copy the final state back to the object. |
99 | //qWarning("%d, %d, %d", currentValue, numSamples, windowPosn); | 103 | //owarn << "" << currentValue << ", " << numSamples << ", " << windowPosn << "" << oendl; |
100 | this->currentValue = currentValue; | 104 | this->currentValue = currentValue; |
101 | this->numSamples = numSamples; | 105 | this->numSamples = numSamples; |
102 | this->windowPosn = windowPosn; | 106 | this->windowPosn = windowPosn; |
103 | } | 107 | } |
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 @@ | |||
1 | config POWERCHORD | 1 | config POWERCHORD |
2 | boolean "opie-powerchord (guitar chord generator and tuning)" | 2 | boolean "opie-powerchord (guitar chord generator and tuning)" |
3 | default "n" | 3 | default "n" |
4 | depends ( LIBQPE || LIBQPE-X11 ) | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE |
5 | comment "opie-powerchord needs a libqpe" | 5 | comment "opie-powerchord needs a libqpe and libopiecore2" |
6 | depends !(( LIBQPE || LIBQPE-X11 ) ) | 6 | depends !(( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE ) |
7 | 7 | ||
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 | |||
@@ -17,10 +17,9 @@ SOURCES = main.cpp \ | |||
17 | powerchordbase.cpp | 17 | powerchordbase.cpp |
18 | 18 | ||
19 | INCLUDEPATH+= $(OPIEDIR)/include | 19 | INCLUDEPATH+= $(OPIEDIR)/include |
20 | DEPENDPATH+= $(OPIEDIR)/include | 20 | DEPENDPATH+= $(OPIEDIR)/include |
21 | LIBS += -lqpe | 21 | LIBS += -lqpe -lopiecore2 |
22 | #INTERFACES= powerchordbase.ui | ||
23 | DESTDIR = $(OPIEDIR)/bin | 22 | DESTDIR = $(OPIEDIR)/bin |
24 | TARGET = powerchord | 23 | TARGET = powerchord |
25 | 24 | ||
26 | include ( $(OPIEDIR)/include.pro ) | 25 | include ( $(OPIEDIR)/include.pro ) |
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 | |||
@@ -6,21 +6,25 @@ | |||
6 | ** | 6 | ** |
7 | ** WARNING! All changes made in this file will be lost! | 7 | ** WARNING! All changes made in this file will be lost! |
8 | ****************************************************************************/ | 8 | ****************************************************************************/ |
9 | #include "powerchordbase.h" | 9 | #include "powerchordbase.h" |
10 | |||
11 | #include "fretboard.h" | 10 | #include "fretboard.h" |
12 | #include "vumeter.h" | 11 | #include "vumeter.h" |
12 | |||
13 | /* OPIE */ | ||
14 | #include <opie2/odebug.h> | ||
15 | #include <qpe/resource.h> | ||
16 | using namespace Opie::Core; | ||
17 | |||
18 | /* QT */ | ||
13 | #include <qcombobox.h> | 19 | #include <qcombobox.h> |
14 | #include <qlabel.h> | 20 | #include <qlabel.h> |
15 | #include <qlistbox.h> | 21 | #include <qlistbox.h> |
16 | #include <qpushbutton.h> | 22 | #include <qpushbutton.h> |
17 | #include <qspinbox.h> | 23 | #include <qspinbox.h> |
18 | #include <qtabwidget.h> | 24 | #include <qtabwidget.h> |
19 | #include <qlayout.h> | 25 | #include <qlayout.h> |
20 | #include <qtooltip.h> | 26 | #include <qtooltip.h> |
21 | #include <qpe/resource.h> | ||
22 | |||
23 | 27 | ||
24 | /* | 28 | /* |
25 | * Constructs a PowerchordBase which is a child of 'parent', with the | 29 | * Constructs a PowerchordBase which is a child of 'parent', with the |
26 | * name 'name' and widget flags set to 'f' | 30 | * name 'name' and widget flags set to 'f' |
@@ -579,7 +583,7 @@ PowerchordBase::~PowerchordBase() | |||
579 | } | 583 | } |
580 | 584 | ||
581 | void PowerchordBase::change_handler() | 585 | void PowerchordBase::change_handler() |
582 | { | 586 | { |
583 | qWarning( "PowerchordBase::change_handler(): Not implemented yet!" ); | 587 | owarn << "PowerchordBase::change_handler(): Not implemented yet!" << oendl; |
584 | } | 588 | } |
585 | 589 | ||
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,15 +1,17 @@ | |||
1 | #include "ImageFileSelector.h" | ||
1 | 2 | ||
3 | /* OPIE */ | ||
4 | #include <opie2/odebug.h> | ||
5 | #include <qpe/qpeapplication.h> | ||
6 | using namespace Opie::Core; | ||
2 | 7 | ||
3 | #include "qpe/qpeapplication.h" | 8 | /* QT */ |
4 | 9 | #include <qlabel.h> | |
5 | #include <stdlib.h> | ||
6 | |||
7 | #include <qlabel.h> | ||
8 | #include <qfileinfo.h> | 10 | #include <qfileinfo.h> |
9 | 11 | ||
10 | #include "ImageFileSelector.h" | 12 | /* STD */ |
11 | 13 | #include <stdlib.h> | |
12 | 14 | ||
13 | ThumbWidget::ThumbWidget(QPixmap p,QString text,const DocLnk& f,QWidget *parent,int w) | 15 | ThumbWidget::ThumbWidget(QPixmap p,QString text,const DocLnk& f,QWidget *parent,int w) |
14 | : QWidget( parent ),fl(f) | 16 | : QWidget( parent ),fl(f) |
15 | { | 17 | { |
@@ -154,9 +156,9 @@ void ImageFileSelector::updateSizes() | |||
154 | } | 156 | } |
155 | 157 | ||
156 | void ImageFileSelector::reread(bool) | 158 | void ImageFileSelector::reread(bool) |
157 | { | 159 | { |
158 | // qDebug("reread"); | 160 | // odebug << "reread" << oendl; |
159 | ImageFileSelectorItem *item = (ImageFileSelectorItem *)detailed->selectedItem(); | 161 | ImageFileSelectorItem *item = (ImageFileSelectorItem *)detailed->selectedItem(); |
160 | QString oldFile; | 162 | QString oldFile; |
161 | if ( item ) | 163 | if ( item ) |
162 | oldFile = item->file().file(); | 164 | oldFile = item->file().file(); |
@@ -220,9 +222,9 @@ int ImageFileSelector::fileCount() | |||
220 | return count; | 222 | return count; |
221 | } | 223 | } |
222 | const DocLnk * ImageFileSelector::selected() | 224 | const DocLnk * ImageFileSelector::selected() |
223 | { | 225 | { |
224 | qDebug("image selected"); | 226 | odebug << "image selected" << oendl; |
225 | ImageFileSelectorItem *item = (ImageFileSelectorItem *) detailed->selectedItem(); | 227 | ImageFileSelectorItem *item = (ImageFileSelectorItem *) detailed->selectedItem(); |
226 | if ( item ) | 228 | if ( item ) |
227 | return new DocLnk( item->file() ); | 229 | return new DocLnk( item->file() ); |
228 | return 0; | 230 | return 0; |
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 | |||
@@ -25,25 +25,27 @@ | |||
25 | #include "showimg.h" | 25 | #include "showimg.h" |
26 | #include "ImageFileSelector.h" | 26 | #include "ImageFileSelector.h" |
27 | #include "settingsdialog.h" | 27 | #include "settingsdialog.h" |
28 | 28 | ||
29 | 29 | /* OPIE */ | |
30 | #include <opie2/odebug.h> | ||
30 | #include <opie2/ofiledialog.h> | 31 | #include <opie2/ofiledialog.h> |
31 | |||
32 | #include <qpe/qpeapplication.h> | 32 | #include <qpe/qpeapplication.h> |
33 | #include <qpe/config.h> | 33 | #include <qpe/config.h> |
34 | #include <qpe/resource.h> | 34 | #include <qpe/resource.h> |
35 | #include <qtoolbar.h> | 35 | using namespace Opie::Core; |
36 | using namespace Opie::Ui; | ||
36 | 37 | ||
38 | /* QT */ | ||
39 | #include <qtoolbar.h> | ||
37 | #include <qaction.h> | 40 | #include <qaction.h> |
38 | #include <qfiledialog.h> | 41 | #include <qfiledialog.h> |
39 | #include <qmenubar.h> | 42 | #include <qmenubar.h> |
40 | #include <qspinbox.h> | 43 | #include <qspinbox.h> |
41 | 44 | ||
45 | /* STD */ | ||
42 | #include <math.h> | 46 | #include <math.h> |
43 | 47 | ||
44 | |||
45 | using namespace Opie::Ui; | ||
46 | ControlsDialog::ControlsDialog(const QString &caption,QImage image,int *brightness,QWidget *parent) | 48 | ControlsDialog::ControlsDialog(const QString &caption,QImage image,int *brightness,QWidget *parent) |
47 | : QDialog(parent,0,true) | 49 | : QDialog(parent,0,true) |
48 | { | 50 | { |
49 | setCaption(caption); | 51 | setCaption(caption); |
@@ -285,9 +287,9 @@ ImageViewer::ImageViewer( QWidget *parent, const char *name, int /*wFlags*/ ) | |||
285 | cv=ImageFileSelector::THUMBNAIL; | 287 | cv=ImageFileSelector::THUMBNAIL; |
286 | else | 288 | else |
287 | cv=ImageFileSelector::DETAILED; | 289 | cv=ImageFileSelector::DETAILED; |
288 | 290 | ||
289 | qDebug("cv = %d",cv); | 291 | odebug << "cv = " << cv << "" << oendl; |
290 | 292 | ||
291 | fileSelector = new ImageFileSelector( cv,stack, "fs"); | 293 | fileSelector = new ImageFileSelector( cv,stack, "fs"); |
292 | 294 | ||
293 | //switchThumbView(); | 295 | //switchThumbView(); |
@@ -412,9 +414,9 @@ void ImageViewer::settings() | |||
412 | dlg.setRotate(rotateOnLoad); | 414 | dlg.setRotate(rotateOnLoad); |
413 | dlg.setFastLoad(fastLoad); | 415 | dlg.setFastLoad(fastLoad); |
414 | 416 | ||
415 | if ( QPEApplication::execDialog(&dlg) == QDialog::Accepted ) { | 417 | if ( QPEApplication::execDialog(&dlg) == QDialog::Accepted ) { |
416 | qDebug("<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>"); | 418 | odebug << "<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>" << oendl; |
417 | slideDelay = dlg.delay(); | 419 | slideDelay = dlg.delay(); |
418 | slideRepeat = dlg.repeat(); | 420 | slideRepeat = dlg.repeat(); |
419 | slideReverse = dlg.reverse(); | 421 | slideReverse = dlg.reverse(); |
420 | rotateOnLoad = dlg.rotate(); | 422 | rotateOnLoad = dlg.rotate(); |
@@ -504,9 +506,9 @@ void ImageViewer::show() | |||
504 | } | 506 | } |
505 | 507 | ||
506 | void ImageViewer::show(const QString& fileref) | 508 | void ImageViewer::show(const QString& fileref) |
507 | { | 509 | { |
508 | // qDebug("Show "+fileref); | 510 | // odebug << "Show "+fileref << oendl; |
509 | bFromDocView = TRUE; | 511 | bFromDocView = TRUE; |
510 | closeFileSelector(); | 512 | closeFileSelector(); |
511 | DocLnk link(fileref); | 513 | DocLnk link(fileref); |
512 | if ( link.isValid() ) { | 514 | if ( link.isValid() ) { |
@@ -534,9 +536,9 @@ void ImageViewer::openFile() { | |||
534 | void ImageViewer::openFile( const DocLnk &link ) | 536 | void ImageViewer::openFile( const DocLnk &link ) |
535 | { | 537 | { |
536 | closeFileSelector(); | 538 | closeFileSelector(); |
537 | // DocLnk link(file); | 539 | // DocLnk link(file); |
538 | qDebug("open "+link.name()); | 540 | odebug << "open "+link.name() << oendl; |
539 | updateCaption( link.name() ); | 541 | updateCaption( link.name() ); |
540 | loadImage( link.file() ); | 542 | loadImage( link.file() ); |
541 | if (slideTimer->isActive()) { | 543 | if (slideTimer->isActive()) { |
542 | slideTimer->start(slideDelay * 1000, FALSE); | 544 | slideTimer->start(slideDelay * 1000, FALSE); |
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,5 +1,5 @@ | |||
1 | CONFIG += qt warn_on quick-app | 1 | CONFIG += qt warn_on quick-app |
2 | HEADERS = showimg.h ImageFileSelector.h settingsdialog.h settingsdialogbase.h | 2 | HEADERS = showimg.h ImageFileSelector.h settingsdialog.h settingsdialogbase.h |
3 | SOURCES = main.cpp showimg.cpp ImageFileSelector.cpp settingsdialog.cpp settingsdialogbase.cpp | 3 | SOURCES = main.cpp showimg.cpp ImageFileSelector.cpp settingsdialog.cpp settingsdialogbase.cpp |
4 | TARGET = showimg | 4 | TARGET = showimg |
5 | INCLUDEPATH += $(OPIEDIR)/include | 5 | INCLUDEPATH += $(OPIEDIR)/include |
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 @@ | |||
1 | config TONLEITER | 1 | config TONLEITER |
2 | boolean "tonleiter (shows scales on sting instruments)" | 2 | boolean "tonleiter (shows scales on sting instruments)" |
3 | default "n" | 3 | default "n" |
4 | depends ( LIBQPE || LIBQPE-X11 ) | 4 | 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,9 +1,14 @@ | |||
1 | #include "editinst.h" | 1 | #include "editinst.h" |
2 | 2 | ||
3 | #include <qpushbutton.h> | 3 | /* OPIE */ |
4 | 4 | #include <opie2/odebug.h> | |
5 | #include <qpe/config.h> | ||
5 | #include <qpe/qpeapplication.h> | 6 | #include <qpe/qpeapplication.h> |
7 | using namespace Opie::Core; | ||
8 | |||
9 | /* QT */ | ||
10 | #include <qpushbutton.h> | ||
6 | 11 | ||
7 | Menu::InstEditDialog::InstEditDialog(TonleiterData* data,QWidget* parent,const char* name) | 12 | Menu::InstEditDialog::InstEditDialog(TonleiterData* data,QWidget* parent,const char* name) |
8 | :QDialog(parent,name,true,0),data(data) | 13 | :QDialog(parent,name,true,0),data(data) |
9 | { | 14 | { |
@@ -99,9 +104,9 @@ void Menu::InstEditDialog::saveInstrument() | |||
99 | void Menu::InstEditDialog::loadInstrument() | 104 | void Menu::InstEditDialog::loadInstrument() |
100 | { | 105 | { |
101 | stringlist.clear(); | 106 | stringlist.clear(); |
102 | Instrument inst=data->getInstrument(instid); | 107 | Instrument inst=data->getInstrument(instid); |
103 | qDebug("load Instrument : %d strings",inst.noOfStrings()); | 108 | odebug << "load Instrument : " << inst.noOfStrings() << " strings" << oendl; |
104 | for(uint s=0;s<inst.noOfStrings();s++) | 109 | for(uint s=0;s<inst.noOfStrings();s++) |
105 | { | 110 | { |
106 | stringlist.append(new EditStringWidget(inst.string(s),stringwidget)); | 111 | stringlist.append(new EditStringWidget(inst.string(s),stringwidget)); |
107 | } | 112 | } |
diff --git a/noncore/multimedia/tonleiter/fretboard.cpp b/noncore/multimedia/tonleiter/fretboard.cpp index 7e63e01..58bdb86 100644 --- a/noncore/multimedia/tonleiter/fretboard.cpp +++ b/noncore/multimedia/tonleiter/fretboard.cpp | |||
@@ -1,6 +1,11 @@ | |||
1 | #include "fretboard.h" | 1 | #include "fretboard.h" |
2 | 2 | ||
3 | /* OPIE */ | ||
4 | #include <opie2/odebug.h> | ||
5 | using namespace Opie::Core; | ||
6 | |||
7 | /* QT */ | ||
3 | #include <qpainter.h> | 8 | #include <qpainter.h> |
4 | 9 | ||
5 | Graph::FretBoard::FretBoard(TonleiterData* data,QWidget* parent,const char* name,WFlags f) | 10 | Graph::FretBoard::FretBoard(TonleiterData* data,QWidget* parent,const char* name,WFlags f) |
6 | :QWidget(parent,name,f),data(data) | 11 | :QWidget(parent,name,f),data(data) |
@@ -26,9 +31,9 @@ void Graph::FretBoard::paintEvent(QPaintEvent* pe) | |||
26 | Q_UNUSED(pe); | 31 | Q_UNUSED(pe); |
27 | 32 | ||
28 | int instid=data->getCurrentInstrumentID(); | 33 | int instid=data->getCurrentInstrumentID(); |
29 | inst=data->getInstrument(instid); | 34 | inst=data->getInstrument(instid); |
30 | //qDebug("inst %d is %s",instid,inst.instName().data()); | 35 | //odebug << "inst " << instid << " is " << inst.instName().data() << "" << oendl; |
31 | 36 | ||
32 | QRect mysize=rect(); | 37 | QRect mysize=rect(); |
33 | 38 | ||
34 | xmargin=(int)(mysize.width()*0.05); | 39 | xmargin=(int)(mysize.width()*0.05); |
@@ -142,19 +147,19 @@ void Graph::FretBoard::paintScale(QPainter* p) | |||
142 | 147 | ||
143 | //no more than six octaves can be visualised (there is a zero octave) | 148 | //no more than six octaves can be visualised (there is a zero octave) |
144 | int octave=Note::octaveOfBaseNote(data->getCurrentBaseNote(),note)-baseoctave; | 149 | int octave=Note::octaveOfBaseNote(data->getCurrentBaseNote(),note)-baseoctave; |
145 | if(octave<0) | 150 | if(octave<0) |
146 | qDebug("%d,%d",octave,baseoctave); | 151 | odebug << "" << octave << "," << baseoctave << "" << oendl; |
147 | if(octave>5) | 152 | if(octave>5) |
148 | { | 153 | { |
149 | qDebug("octave out of range"); | 154 | odebug << "octave out of range" << oendl; |
150 | octave=5; | 155 | octave=5; |
151 | } | 156 | } |
152 | 157 | ||
153 | p->setPen(QColor(255,0,0)); | 158 | p->setPen(QColor(255,0,0)); |
154 | int c= ( (note-12*baseoctave) - (12*octave+data->getCurrentBaseNote()) )*15; | 159 | int c= ( (note-12*baseoctave) - (12*octave+data->getCurrentBaseNote()) )*15; |
155 | if(c<0 || c>255) | 160 | if(c<0 || c>255) |
156 | qDebug("%d = %d - ( %d + %d)",c,note,12*octave,data->getCurrentBaseNote()); | 161 | odebug << "" << c << " = " << note << " - ( " << 12*octave << " + " << data->getCurrentBaseNote() << ")" << oendl; |
157 | QColor dotcolor(255,255,255); | 162 | QColor dotcolor(255,255,255); |
158 | 163 | ||
159 | if(octave==0) | 164 | if(octave==0) |
160 | dotcolor=QColor(c,c,255); | 165 | dotcolor=QColor(c,c,255); |
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 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | #CONFIG = qt warn_on | ||
3 | CONFIG = qt warn_on | 2 | CONFIG = qt warn_on |
4 | HEADERS = mainwidget.h tonleiterdata.h tonleiterdatahelper.h fretboard.h menuwidget.h editinst.h editstringwidget.h editscale.h pianoscale.h | 3 | HEADERS = mainwidget.h tonleiterdata.h tonleiterdatahelper.h fretboard.h menuwidget.h editinst.h editstringwidget.h editscale.h pianoscale.h |
5 | SOURCES = mainwidget.cpp tonleiterdata.cpp tonleiterdatahelper.cpp fretboard.cpp menuwidget.cpp main.cpp editinst.cpp editstringwidget.cpp editscale.cpp pianoscale.cpp | 4 | SOURCES = mainwidget.cpp tonleiterdata.cpp tonleiterdatahelper.cpp fretboard.cpp menuwidget.cpp main.cpp editinst.cpp editstringwidget.cpp editscale.cpp pianoscale.cpp |
6 | INCLUDEPATH += $(OPIEDIR)/include | 5 | INCLUDEPATH += $(OPIEDIR)/include |
7 | DEPENDPATH += $(OPIEDIR)/include | 6 | DEPENDPATH += $(OPIEDIR)/include |
8 | LIBS += -lqpe | 7 | LIBS += -lqpe -lopiecore2 |
9 | INTERFACES = | ||
10 | TARGET = tonleiter | 8 | TARGET = tonleiter |
11 | DESTDIR = $(OPIEDIR)/bin | 9 | DESTDIR = $(OPIEDIR)/bin |
12 | #TMAKE_CXXFLAGS += -DQT_QWS_VERCEL_IDR -DQWS -fno-exceptions -fno-rtti | 10 | |
13 | include ( $(OPIEDIR)/include.pro ) | 11 | 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,10 +1,11 @@ | |||
1 | #include "tonleiterdata.h" | 1 | #include "tonleiterdata.h" |
2 | |||
3 | #include <qpe/config.h> | ||
4 | |||
5 | using namespace Data; | 2 | using namespace Data; |
6 | 3 | ||
4 | /* OPIE */ | ||
5 | #include <opie2/odebug.h> | ||
6 | #include <qpe/config.h> | ||
7 | using namespace Opie::Core; | ||
7 | 8 | ||
8 | TonleiterData::TonleiterData(QObject* parent) | 9 | TonleiterData::TonleiterData(QObject* parent) |
9 | :QObject(parent) | 10 | :QObject(parent) |
10 | { | 11 | { |
@@ -151,9 +152,9 @@ Instrument TonleiterData::getInstrument(int id) | |||
151 | if(id>=0 && id<noOfInstruments()) | 152 | if(id>=0 && id<noOfInstruments()) |
152 | return instruments[id]; | 153 | return instruments[id]; |
153 | else | 154 | else |
154 | { | 155 | { |
155 | qDebug("undefined insrtument %d of %d",id,instruments.count()); | 156 | odebug << "undefined insrtument " << id << " of " << instruments.count() << "" << oendl; |
156 | return Instrument(); | 157 | return Instrument(); |
157 | } | 158 | } |
158 | 159 | ||
159 | } | 160 | } |
@@ -173,9 +174,9 @@ Scale TonleiterData::getScale(int id) | |||
173 | if(id>=0 && id<noOfScales()) | 174 | if(id>=0 && id<noOfScales()) |
174 | return scales[id]; | 175 | return scales[id]; |
175 | else | 176 | else |
176 | { | 177 | { |
177 | qDebug("Undefined scale"); | 178 | odebug << "Undefined scale" << oendl; |
178 | return Scale(); | 179 | return Scale(); |
179 | } | 180 | } |
180 | } | 181 | } |
181 | //**************************************************************************** | 182 | //**************************************************************************** |
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 | |||
@@ -33,9 +33,9 @@ int Note::getNoteFromName(QString name,int octave) | |||
33 | int Note::octaveOfBaseNote(int base,int note) | 33 | int Note::octaveOfBaseNote(int base,int note) |
34 | { | 34 | { |
35 | int normnote = (note>=base) ? note-base : (12-base)+note; | 35 | int normnote = (note>=base) ? note-base : (12-base)+note; |
36 | int octave=getOctaveOfNote(normnote); | 36 | int octave=getOctaveOfNote(normnote); |
37 | //qDebug("note %d of %d base is norm %d -> ocatve %d",note,base,normnote,octave); | 37 | //odebug << "note " << note << " of " << base << " base is norm " << normnote << " -> ocatve " << octave << "" << oendl; |
38 | return octave; | 38 | return octave; |
39 | } | 39 | } |
40 | //**************************************************************************** | 40 | //**************************************************************************** |
41 | //**************************************************************************** | 41 | //**************************************************************************** |
@@ -130,14 +130,14 @@ bool Scale::noteInScale(int base,int note) | |||
130 | int normnote = (note>=base) ? note-base : (12-base)+note; | 130 | int normnote = (note>=base) ? note-base : (12-base)+note; |
131 | 131 | ||
132 | if(halftones.contains(normnote)>0) | 132 | if(halftones.contains(normnote)>0) |
133 | { | 133 | { |
134 | //qDebug("OK : base : %d, note %d -> norm %d",base,note,normnote); | 134 | //odebug << "OK : base : " << base << ", note " << note << " -> norm " << normnote << "" << oendl; |
135 | return true; | 135 | return true; |
136 | } | 136 | } |
137 | else | 137 | else |
138 | { | 138 | { |
139 | //qDebug("BAD : base : %d, note %d -> norm %d",base,note,normnote); | 139 | //odebug << "BAD : base : " << base << ", note " << note << " -> norm " << normnote << "" << oendl; |
140 | return false; | 140 | return false; |
141 | } | 141 | } |
142 | } | 142 | } |
143 | //**************************************************************************** | 143 | //**************************************************************************** |