summaryrefslogtreecommitdiff
path: root/noncore/multimedia
authormickeyl <mickeyl>2004-04-04 13:54:40 (UTC)
committer mickeyl <mickeyl>2004-04-04 13:54:40 (UTC)
commit16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (side-by-side diff)
tree0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/multimedia
parent8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff)
downloadopie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip
opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz
opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2
convert to Opie Debugging Framework
Diffstat (limited to 'noncore/multimedia') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp8
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp12
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp12
-rw-r--r--noncore/multimedia/opieplayer2/om3u.cpp14
-rw-r--r--noncore/multimedia/opieplayer2/playlistselection.cpp10
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp38
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidgetgui.cpp2
-rw-r--r--noncore/multimedia/opieplayer2/skin.cpp24
-rw-r--r--noncore/multimedia/opieplayer2/threadutil.cpp6
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.cpp8
-rw-r--r--noncore/multimedia/opierec/device.cpp46
-rw-r--r--noncore/multimedia/opierec/helpwindow.cpp11
-rw-r--r--noncore/multimedia/opierec/opierec.pro6
-rw-r--r--noncore/multimedia/opierec/qtrec.cpp129
-rw-r--r--noncore/multimedia/opierec/wavFile.cpp67
-rw-r--r--noncore/multimedia/opierec/waveform.cpp12
-rw-r--r--noncore/multimedia/powerchord/config.in6
-rw-r--r--noncore/multimedia/powerchord/powerchord.pro3
-rw-r--r--noncore/multimedia/powerchord/powerchordbase.cpp12
-rw-r--r--noncore/multimedia/showimg/ImageFileSelector.cpp20
-rw-r--r--noncore/multimedia/showimg/showimg.cpp20
-rw-r--r--noncore/multimedia/showimg/showimg.pro2
-rw-r--r--noncore/multimedia/tonleiter/config.in2
-rw-r--r--noncore/multimedia/tonleiter/editinst.cpp11
-rw-r--r--noncore/multimedia/tonleiter/fretboard.cpp13
-rw-r--r--noncore/multimedia/tonleiter/tonleiter.pro6
-rw-r--r--noncore/multimedia/tonleiter/tonleiterdata.cpp11
-rw-r--r--noncore/multimedia/tonleiter/tonleiterdatahelper.cpp6
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
@@ -130,13 +130,13 @@ void AudioWidget::sliderReleased() {
return;
long val = long((double)slider.value() * mediaPlayerState.length() / slider.width());
mediaPlayerState.setPosition( val );
}
void AudioWidget::setPosition( long i ) {
- // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<set position %d",i);
+ // odebug << "<<<<<<<<<<<<<<<<<<<<<<<<set position " << i << "" << oendl;
updateSlider( i, mediaPlayerState.length() );
}
void AudioWidget::setLength( long max ) {
updateSlider( mediaPlayerState.position(), max );
@@ -184,25 +184,25 @@ void AudioWidget::loadSkin()
resizeEvent( 0 );
}
void AudioWidget::setSeekable( bool isSeekable ) {
if ( !isSeekable ) {
- qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>");
+ odebug << "<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>" << oendl;
if( !slider.isHidden()) {
slider.hide();
}
disconnect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
disconnect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
disconnect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
disconnect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
} else {
// this stops the slider from being moved, thus
// does not stop stream when it reaches the end
slider.show();
- qDebug( " CONNECT SET POSTION " );
+ odebug << " CONNECT SET POSTION " << oendl;
connect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
connect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
}
}
@@ -268,13 +268,13 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e) {
switch ( e->key() ) {
////////////////////////////// Zaurus keys
case Key_Home:
break;
case Key_F9: //activity
hide();
- // qDebug("Audio F9");
+ // odebug << "Audio F9" << oendl;
e->accept();
break;
case Key_F10: //contacts
break;
case Key_F11: //menu
mediaPlayerState.toggleBlank();
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
@@ -103,16 +103,16 @@ Lib::Lib( InitializationMode initMode, XineVideoWidget* widget )
else
start();
}
void Lib::run()
{
- qDebug( "Lib::run() started" );
+ odebug << "Lib::run() started" << oendl;
initialize();
m_initialized = true;
- qDebug( "Lib::run() finished" );
+ odebug << "Lib::run() finished" << oendl;
}
void Lib::initialize()
{
m_duringInitialization = true;
m_xine = xine_new( );
@@ -212,13 +212,13 @@ int Lib::play( const QString& fileName, int startPos, int start_time ) {
return xine_play( m_stream, startPos, start_time);
}
void Lib::stop() {
assert( m_initialized );
- qDebug("<<<<<<<< STOP IN LIB TRIGGERED >>>>>>>");
+ odebug << "<<<<<<<< STOP IN LIB TRIGGERED >>>>>>>" << oendl;
xine_stop( m_stream );
}
void Lib::pause( bool toggle ) {
assert( m_initialized );
@@ -324,15 +324,15 @@ int Lib::error() const {
void Lib::ensureInitialized()
{
if ( m_initialized )
return;
- qDebug( "waiting for initialization thread to finish" );
+ odebug << "waiting for initialization thread to finish" << oendl;
wait();
- qDebug( "initialization thread finished!" );
+ odebug << "initialization thread finished!" << oendl;
}
void Lib::setWidget( XineVideoWidget *widget )
{
m_wid = widget;
resize ( m_wid-> size ( ) );
@@ -419,13 +419,13 @@ void Lib::xine_display_frame( void* user_data, uint8_t *frame,
}
void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) {
assert( m_initialized );
if ( !m_video ) {
- qWarning("not showing video now");
+ owarn << "not showing video now" << oendl;
return;
}
assert( m_wid );
m_wid-> setVideoFrame ( frame, width, height, bytes );
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
@@ -149,13 +149,13 @@ void MediaPlayer::next() {
play();
}
} else {
mediaPlayerState.setList();
}
} else { //if playing from file list, let's just stop
- qDebug("<<<<<<<<<<<<<<<<<stop for filelists");
+ odebug << "<<<<<<<<<<<<<<<<<stop for filelists" << oendl;
mediaPlayerState.setPlaying(false);
mediaPlayerState.setDisplayType( MediaPlayerState::MediaSelection );
if(l) mediaPlayerState.setLooping(l);
if(r) mediaPlayerState.setShuffled(r);
}
qApp->processEvents();
@@ -282,37 +282,37 @@ void MediaPlayer::blank( bool b ) {
fd=open("/dev/fb0",O_RDWR);
#ifdef QT_QWS_SL5XXX
fl= open( "/dev/fl", O_RDWR );
#endif
if (fd != -1) {
if ( b ) {
- qDebug("do blanking");
+ odebug << "do blanking" << oendl;
#ifdef QT_QWS_SL5XXX
ioctl( fd, FBIOBLANK, 1 );
if(fl !=-1) {
ioctl( fl, 2 );
::close(fl);
}
#else
ioctl( fd, FBIOBLANK, 3 );
#endif
isBlanked = TRUE;
} else {
- qDebug("do unblanking");
+ odebug << "do unblanking" << oendl;
ioctl( fd, FBIOBLANK, 0);
#ifdef QT_QWS_SL5XXX
if(fl != -1) {
ioctl( fl, 1);
::close(fl);
}
#endif
isBlanked = FALSE;
}
close( fd );
} else {
- qDebug("<< /dev/fb0 could not be opened >>");
+ odebug << "<< /dev/fb0 could not be opened >>" << oendl;
}
}
void MediaPlayer::keyReleaseEvent( QKeyEvent *e) {
switch ( e->key() ) {
////////////////////////////// Zaurus keys
@@ -322,17 +322,17 @@ void MediaPlayer::keyReleaseEvent( QKeyEvent *e) {
break;
case Key_F10: //contacts
break;
case Key_F11: //menu
break;
case Key_F12: //home
- qDebug("Blank here");
+ odebug << "Blank here" << oendl;
// mediaPlayerState->toggleBlank();
break;
case Key_F13: //mail
- qDebug("Blank here");
+ odebug << "Blank here" << oendl;
// mediaPlayerState->toggleBlank();
break;
}
}
void MediaPlayer::cleanUp() {// this happens on closing
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
@@ -34,36 +34,36 @@
//extern PlayListWidget *playList;
Om3u::Om3u( const QString &filePath, int mode)
: QStringList (){
-qDebug("<<<<<<<new m3u "+filePath);
+odebug << "<<<<<<<new m3u "+filePath << oendl;
f.setName(filePath);
f.open(mode);
}
Om3u::~Om3u(){}
void Om3u::readM3u() {
-// qDebug("<<<<<<reading m3u "+f.name());
+// odebug << "<<<<<<reading m3u "+f.name() << oendl;
QTextStream t(&f);
t.setEncoding(QTextStream::UnicodeUTF8);
QString s;
while ( !t.atEnd() ) {
s=t.readLine();
-// qDebug(s);
+// odebug << s << oendl;
if( s.find( "#", 0, TRUE) == -1 ) {
if( s.left(2) == "E:" || s.left(2) == "P:" ) {
s = s.right( s.length() -2 );
QFileInfo f( s );
QString name = f.baseName();
name = name.right( name.length() - name.findRev( "\\", -1, TRUE ) -1 );
s=s.replace( QRegExp( "\\" ), "/" );
append(s);
-// qDebug(s);
+// odebug << s << oendl;
} else { // is url
QString name;
name = s;
append(name);
}
}
@@ -77,13 +77,13 @@ void Om3u::readPls() { //it's a pls file
while ( !t.atEnd() ) {
s = t.readLine();
if( s.left(4) == "File" ) {
s = s.right( s.length() - s.find("=",0,true)-1 );
s = s.stripWhiteSpace();
s.replace( QRegExp( "%20" )," ");
-// qDebug( "adding " + s + " to playlist" );
+// odebug << "adding " + s + " to playlist" << oendl;
// numberofentries=2
// File1=http
// Title
// Length
// Version
// File2=http
@@ -111,13 +111,13 @@ void Om3u::readPls() { //it's a pls file
void Om3u::write() { //writes list to m3u file
QString list;
QTextStream t(&f);
t.setEncoding(QTextStream::UnicodeUTF8);
if(count()>0) {
for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) {
-// qDebug(*it);
+// odebug << *it << oendl;
t << *it << "\n";
}
}
// f.close();
}
@@ -127,13 +127,13 @@ void Om3u::add(const QString &filePath) { //adds to m3u file
void Om3u::remove(const QString &filePath) { //removes from m3u list
QString list, currentFile;
if(count()>0) {
for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) {
currentFile=*it;
- // qDebug(*it);
+ // odebug << *it << oendl;
if( filePath != currentFile)
list += currentFile+"\n";
}
f.writeBlock( list, list.length() );
}
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
@@ -41,13 +41,13 @@ private:
};
PlayListSelection::PlayListSelection( QWidget *parent, const char *name )
: QListView( parent, name )
{
-// qDebug("starting playlistselector");
+// odebug << "starting playlistselector" << oendl;
// #ifdef USE_PLAYLIST_BACKGROUND
// setStaticBackground( TRUE );
// setBackgroundPixmap( Resource::loadPixmap( "opieplayer/background" ) );
// setBackgroundPixmap( Resource::loadPixmap( "launcher/opielogo" ) );
// #endif
@@ -62,13 +62,13 @@ PlayListSelection::PlayListSelection( QWidget *parent, const char *name )
PlayListSelection::~PlayListSelection() {
}
// #ifdef USE_PLAYLIST_BACKGROUND
void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) {
-// qDebug("drawBackground");
+// odebug << "drawBackground" << oendl;
p->fillRect( r, QBrush( white ) );
// QImage logo = Resource::loadImage( "launcher/opielogo" );
// if ( !logo.isNull() )
// p->drawImage( (width() - logo.width()) / 2, (height() - logo.height()) / 2, logo );
}
// #endif
@@ -181,24 +181,24 @@ void PlayListSelection::unSelect()
void PlayListSelection::writeCurrent( Config& cfg ) {
cfg.setGroup("PlayList");
QListViewItem *item = selectedItem();
if ( item )
cfg.writeEntry("current", item->text(0) );
- qDebug(item->text(0));
+ odebug << item->text(0) << oendl;
}
void PlayListSelection::setSelectedItem(const QString &strk ) {
unSelect();
QListViewItemIterator it( this );
for ( ; it.current(); ++it ) {
-// qDebug( it.current()->text(0));
+// odebug << it.current()->text(0) << oendl;
if( strk == it.current()->text(0)) {
-// qDebug( "We have a match "+strk);
+// odebug << "We have a match "+strk << oendl;
setSelected( it.current(), TRUE);
ensureItemVisible( it.current() );
return;
}
}
// setSelected( item, TRUE );
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
@@ -179,17 +179,17 @@ void PlayListWidget::writeDefaultPlaylist() {
Config config( "OpiePlayer" );
config.setGroup( "PlayList" );
QString filename=QPEApplication::documentDir() + "/default.m3u";
QString currentString = config.readEntry( "CurrentPlaylist", filename);
if( currentString == filename) {
Om3u *m3uList;
- // qDebug("<<<<<<<<<<<<<default>>>>>>>>>>>>>>>>>>>");
+ // odebug << "<<<<<<<<<<<<<default>>>>>>>>>>>>>>>>>>>" << oendl;
if( d->selectedFiles->first() ) {
m3uList = new Om3u(filename, IO_ReadWrite | IO_Truncate);
do {
- // qDebug(d->selectedFiles->current()->file());
+ // odebug << d->selectedFiles->current()->file() << oendl;
m3uList->add( d->selectedFiles->current()->file() );
}
while ( d->selectedFiles->next() );
m3uList->write();
m3uList->close();
@@ -322,13 +322,13 @@ void PlayListWidget::addAllVideoToList() {
writeCurrentM3u();
d->selectedFiles->first();
}
void PlayListWidget::setDocument( const QString& fileref ) {
- // qDebug( "<<<<<<<<set document>>>>>>>>>> "+fileref );
+ // odebug << "<<<<<<<<set document>>>>>>>>>> "+fileref << oendl;
fromSetDocument = TRUE;
QFileInfo fileInfo(fileref);
if ( !fileInfo.exists() ) {
QMessageBox::warning( this, tr( "Invalid File" ),
tr( "There was a problem in getting the file." ) );
@@ -398,13 +398,13 @@ bool PlayListWidget::prev() {
return TRUE;
}
}
bool PlayListWidget::next() {
-//qDebug("<<<<<<<<<<<<next()");
+//odebug << "<<<<<<<<<<<<next()" << oendl;
if ( mediaPlayerState->isShuffled() ) {
return prev();
} else {
if ( !d->selectedFiles->next() ) {
if ( mediaPlayerState->isLooping() ) {
return d->selectedFiles->first();
@@ -609,13 +609,13 @@ void PlayListWidget::openURL() {
QString filename, name;
InputDialog *fileDlg;
fileDlg = new InputDialog(this,tr("Add URL"),TRUE, 0);
fileDlg->exec();
if( fileDlg->result() == 1 ) {
filename = fileDlg->text();
- qDebug( "Selected filename is " + filename );
+ odebug << "Selected filename is " + filename << oendl;
// Om3u *m3uList;
DocLnk lnk;
Config cfg( "OpiePlayer" );
cfg.setGroup("PlayList");
if(filename.left(4) == "http") {
@@ -685,13 +685,13 @@ void PlayListWidget::openFile() {
str=str.right(str.length()-1);
}
cfg.writeEntry( "LastDirectory" ,QFileInfo( str ).dirPath() );
if( !str.isEmpty() ) {
- qDebug( "Selected filename is " + str );
+ odebug << "Selected filename is " + str << oendl;
filename = str;
DocLnk lnk;
if( filename.right( 3) == "m3u" || filename.right(3) == "pls" ) {
readListFromFile( filename );
} else {
@@ -703,26 +703,26 @@ void PlayListWidget::openFile() {
}
}
}
void PlayListWidget::readListFromFile( const QString &filename ) {
- qDebug( "read list filename " + filename );
+ odebug << "read list filename " + filename << oendl;
QFileInfo fi(filename);
Om3u *m3uList;
QString s, name;
m3uList = new Om3u( filename, IO_ReadOnly );
if(fi.extension(false).find("m3u",0,false) != -1 )
m3uList->readM3u();
else if(fi.extension(false).find("pls",0,false) != -1 )
m3uList->readPls();
DocLnk lnk;
for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) {
s = *it;
- // qDebug(s);
+ // odebug << s << oendl;
if(s.left(4)=="http") {
lnk.setName( s ); //sets file name
lnk.setIcon("opieplayer2/musicfile");
lnk.setFile( s ); //sets file name
} else { //is file
@@ -750,27 +750,27 @@ void PlayListWidget::readListFromFile( const QString &filename ) {
setCaption(tr("OpiePlayer: ")+ QFileInfo(filename).baseName());
}
// writes current playlist to current m3u file */
void PlayListWidget::writeCurrentM3u() {
- qDebug("writing to current m3u");
+ odebug << "writing to current m3u" << oendl;
Config cfg( "OpiePlayer" );
cfg.setGroup("PlayList");
QString currentPlaylist = cfg.readEntry("CurrentPlaylist","default");
Om3u *m3uList;
m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate );
if( d->selectedFiles->first()) {
do {
- // qDebug( "add writeCurrentM3u " +d->selectedFiles->current()->file());
+ // odebug << "add writeCurrentM3u " +d->selectedFiles->current()->file() << oendl;
m3uList->add( d->selectedFiles->current()->file() );
}
while ( d->selectedFiles->next() );
- // qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" );
+ // odebug << "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" << oendl;
m3uList->write();
m3uList->close();
}
delete m3uList;
}
@@ -809,13 +809,13 @@ void PlayListWidget::writem3u() {
QString name, filename, list;
Om3u *m3uList;
if( !str.isEmpty() ) {
name = str;
// name = fileDlg->text();
-// qDebug( filename );
+// odebug << filename << oendl;
if( name.find("/",0,true) != -1) {// assume they specify a file path
filename = name;
name = name.right(name.length()- name.findRev("/",-1,true) - 1 );
}
else //otherwise dump it somewhere noticable
filename = QPEApplication::documentDir() + "/" + name;
@@ -827,33 +827,33 @@ void PlayListWidget::writem3u() {
m3uList = new Om3u( filename, IO_ReadWrite | IO_Truncate);
do {
m3uList->add( d->selectedFiles->current()->file());
}
while ( d->selectedFiles->next() );
- // qDebug( list );
+ // odebug << list << oendl;
m3uList->write();
m3uList->close();
delete m3uList;
//delete fileDlg;
DocLnk lnk;
lnk.setFile( filename);
lnk.setIcon("opieplayer2/playlist2");
lnk.setName( name); //sets file name
- // qDebug(filename);
+ // odebug << filename << oendl;
Config config( "OpiePlayer" );
config.setGroup( "PlayList" );
config.writeEntry("CurrentPlaylist",filename);
currentPlayList=filename;
if(!lnk.writeLink()) {
- qDebug("Writing doclink did not work");
+ odebug << "Writing doclink did not work" << oendl;
}
setCaption(tr("OpiePlayer: ") + name);
}
}
}
@@ -881,13 +881,13 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) {
addSelected();
break;
case Key_R: //remove from playlist
removeSelected();
break;
// case Key_P: //play
- // qDebug("Play");
+ // odebug << "Play" << oendl;
// playSelected();
// break;
case Key_Space:
// playSelected(); puh
break;
case Key_1:
@@ -911,13 +911,13 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) {
// d->selectedFiles->last();
break;
}
}
void PlayListWidget::pmViewActivated(int index) {
-// qDebug("%d", index);
+// odebug << "" << index << "" << oendl;
switch(index) {
case -16:
{
mediaPlayerState->toggleFullscreen();
bool b=mediaPlayerState->isFullscreen();
pmView->setItemChecked( index, b);
@@ -941,13 +941,13 @@ void PlayListWidget::populateSkinsMenu() {
skinsDir.setSorting(QDir::Name );
const QFileInfoList *skinslist = skinsDir.entryInfoList();
QFileInfoListIterator it( *skinslist );
QFileInfo *fi;
while ( ( fi = it.current() ) ) {
skinName = fi->fileName();
-// qDebug( fi->fileName() );
+// odebug << fi->fileName() << oendl;
if( skinName != "." && skinName != ".." && skinName !="CVS" ) {
item = skinsMenu->insertItem( fi->fileName() ) ;
}
if( skinName == "default" ) {
defaultSkinIndex = item;
}
@@ -997,13 +997,13 @@ PlayListWidget::Entry PlayListWidget::currentEntry() const
QString PlayListWidget::currentFileListPathName() const {
return currentFileListView->currentItem()->text( 3 );
}
void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) {
- qDebug("qcop message "+msg );
+ odebug << "qcop message "+msg << oendl;
QDataStream stream ( data, IO_ReadOnly );
if ( msg == "play()" ) { //plays current selection
btnPlay( true);
} else if ( msg == "stop()" ) {
mediaPlayerState->setPlaying( false);
} else if ( msg == "togglePause()" ) {
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
@@ -180,13 +180,13 @@ void PlayListWidgetGui::setView( char view ) {
else
hide();
}
void PlayListWidgetGui::setActiveWindow() {
- // qDebug("SETTING active window");
+ // odebug << "SETTING active window" << oendl;
// When we get raised we need to ensure that it switches views
MediaPlayerState::DisplayType origDisplayType = mediaPlayerState->displayType();
mediaPlayerState->setDisplayType( MediaPlayerState::MediaSelection ); // invalidate
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
@@ -175,17 +175,17 @@ SkinData *SkinCache::lookupAndTake( const QString &skinPath, const QString &file
QString key = skinPath + fileNameInfix;
SkinData *data = m_cache.take( key );
if ( !data )
data = new SkinData;
else
- qDebug( "SkinCache: hit" );
+ odebug << "SkinCache: hit" << oendl;
QPixmap *bgPixmap = m_backgroundPixmapCache.find( skinPath );
if ( bgPixmap ) {
- qDebug( "SkinCache: hit on bgpixmap" );
+ odebug << "SkinCache: hit on bgpixmap" << oendl;
data->backgroundPixmap = *bgPixmap;
}
else
data->backgroundPixmap = QPixmap();
return data;
@@ -215,38 +215,38 @@ SkinLoader::IncrementalLoader::IncrementalLoader( const Info &info )
}
SkinLoader::IncrementalLoader::LoaderResult SkinLoader::IncrementalLoader::loadStep()
{
switch ( m_currentState ) {
case LoadBackgroundPixmap:
- qDebug( "load bgpixmap" );
+ odebug << "load bgpixmap" << oendl;
m_skin.backgroundPixmap();
m_currentState = LoadButtonUpImage;
break;
case LoadButtonUpImage:
- qDebug( "load upimage" );
+ odebug << "load upimage" << oendl;
m_skin.buttonUpImage();
m_currentState = LoadButtonDownImage;
break;
case LoadButtonDownImage:
- qDebug( "load downimage" );
+ odebug << "load downimage" << oendl;
m_skin.buttonDownImage();
m_currentState = LoadButtonMasks;
m_currentButton = 0;
break;
case LoadButtonMasks:
- qDebug( "load button masks %i", m_currentButton );
+ odebug << "load button masks " << m_currentButton << "" << oendl;
m_skin.buttonMaskImage( m_info.buttonInfo[ m_currentButton ].fileName );
m_currentButton++;
if ( m_currentButton >= m_info.buttonCount )
m_currentState = LoadButtonMask;
break;
case LoadButtonMask:
- qDebug( "load whole mask" );
+ odebug << "load whole mask" << oendl;
m_skin.buttonMask( m_info.buttonInfo, m_info.buttonCount );
return LoadingCompleted;
}
return MoreToCome;
}
@@ -255,13 +255,13 @@ SkinLoader::SkinLoader()
: m_currentLoader( 0 ), m_timerId( -1 )
{
}
SkinLoader::~SkinLoader()
{
- qDebug( "SkinLoader::~SkinLoader()" );
+ odebug << "SkinLoader::~SkinLoader()" << oendl;
killTimers();
delete m_currentLoader;
}
void SkinLoader::schedule( const MediaWidget::GUIInfo &guiInfo )
{
@@ -274,46 +274,46 @@ void SkinLoader::schedule( const QString &skinName, const MediaWidget::GUIInfo &
}
void SkinLoader::start()
{
assert( m_timerId == -1 );
m_timerId = startTimer( 100 /* ms */ );
- qDebug( "SkinLoader::start() %d jobs", pendingSkins.count() );
+ odebug << "SkinLoader::start() " << pendingSkins.count() << " jobs" << oendl;
}
void SkinLoader::timerEvent( QTimerEvent *ev )
{
if ( ev->timerId() != m_timerId ) {
QObject::timerEvent( ev );
return;
}
if ( !m_currentLoader ) {
if ( pendingSkins.isEmpty() ) {
- qDebug( "all jobs done" );
+ odebug << "all jobs done" << oendl;
killTimer( m_timerId );
m_timerId = -1;
// ### qt3: use deleteLater();
QTimer::singleShot( 0, this, SLOT( deleteMe() ) );
return;
}
Info nfo = *pendingSkins.begin();
pendingSkins.remove( pendingSkins.begin() );
m_currentLoader = new IncrementalLoader( nfo );
- qDebug( "new loader %i jobs left", pendingSkins.count() );
+ odebug << "new loader " << pendingSkins.count() << " jobs left" << oendl;
}
if ( m_currentLoader->loadStep() == IncrementalLoader::LoadingCompleted ) {
delete m_currentLoader;
m_currentLoader = 0;
}
- qDebug( "finished step" );
+ odebug << "finished step" << oendl;
}
void SkinLoader::deleteMe()
{
delete this;
}
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
@@ -184,22 +184,22 @@ Thread::~Thread()
void Thread::start()
{
AutoLock lock( d->guard );
if ( d->isRunning ) {
- qDebug( "ThreadUtil::Thread::start() called for running thread." );
+ odebug << "ThreadUtil::Thread::start() called for running thread." << oendl;
return;
}
pthread_attr_t attributes;
pthread_attr_init( &attributes );
pthread_attr_setscope( &attributes, PTHREAD_SCOPE_SYSTEM );
int err = pthread_create( &d->self, &attributes, start_thread, ( void* )d );
if ( err != 0 ) {
- qDebug( "ThreadUtil::Thread::start() : can't create thread: %s", strerror( err ) );
+ odebug << "ThreadUtil::Thread::start() : can't create thread: " << strerror( err ) << "" << oendl;
pthread_attr_destroy( &attributes );
return;
}
pthread_attr_destroy( &attributes );
}
@@ -281,13 +281,13 @@ ChannelMessage::~ChannelMessage()
}
void ChannelMessage::reply()
{
if ( !m_isCall )
{
- qDebug( "ChannelMessage::reply() - can't reply oneway message!" );
+ odebug << "ChannelMessage::reply() - can't reply oneway message!" << oendl;
return;
}
if ( m_inEventHandler )
{
m_replied = true;
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
@@ -90,31 +90,31 @@ XineControl::~XineControl() {
void XineControl::play( const QString& fileName ) {
hasVideoChannel = FALSE;
hasAudioChannel = FALSE;
m_fileName = fileName;
- qDebug("<<FILENAME: " + fileName + ">>>>");
+ odebug << "<<FILENAME: " + fileName + ">>>>" << oendl;
if ( !libXine->play( fileName, 0, 0 ) ) {
QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() );
// toggle stop so the the play button is reset
mediaPlayerState.setPlaying( false );
return;
}
mediaPlayerState.setPlaying( true );
MediaPlayerState::DisplayType displayType;
if ( !libXine->hasVideo() ) {
displayType = MediaPlayerState::Audio;
- qDebug("HAS AUDIO");
+ odebug << "HAS AUDIO" << oendl;
libXine->setShowVideo( false );
hasAudioChannel = TRUE;
} else {
displayType = MediaPlayerState::Video;
- qDebug("HAS VIDEO");
+ odebug << "HAS VIDEO" << oendl;
libXine->setShowVideo( true );
hasVideoChannel = TRUE;
}
// determine if slider is shown
mediaPlayerState.setIsSeekable( libXine->isSeekable() );
@@ -240,13 +240,13 @@ QString XineControl::getMetaInfo() {
}
QString XineControl::getErrorCode() {
int errorCode = libXine->error();
- qDebug( QString("ERRORCODE: %1 ").arg(errorCode) );
+ odebug << QString("ERRORCODE: %1 ").arg(errorCode) << oendl;
if ( errorCode == 1 ) {
return tr( "No input plugin found for this media type" );
} else if ( errorCode == 2 ) {
return tr( "No demux plugin found for this media type" );
} else if ( errorCode == 3 ) {
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,24 +1,24 @@
// device.cpp
#include "device.h"
+/* OPIE */
+#include <opie2/odebug.h>
#include <qpe/config.h>
#include <qpe/qcopenvelope_qws.h>
+using namespace Opie::Core;
-
+/* STD */
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/soundcard.h>
#include <unistd.h>
-#include<sys/wait.h>
-// #include <sys/stat.h>
-// #include <sys/time.h>
-// #include <sys/types.h>
+#include <sys/wait.h>
#include <unistd.h>
#include <errno.h>
//extern QtRec *qperec;
Device::Device( QObject * parent, const char * dsp, const char * mixr, bool record )
@@ -29,16 +29,16 @@ Device::Device( QObject * parent, const char * dsp, const char * mixr, bool reco
devForm=-1;
devCh=-1;
devRate=-1;
if( !record){ //playing
- qDebug("setting up DSP for playing");
+ odebug << "setting up DSP for playing" << oendl;
flags = O_WRONLY;
} else { //recording
- qDebug("setting up DSP for recording");
+ odebug << "setting up DSP for recording" << oendl;
flags = O_RDWR;
// flags = O_RDONLY;
// selectMicInput();
}
@@ -93,13 +93,13 @@ void Device::changedOutVolume(int vol) {
perror("ioctl(\"MIXER_IN_WRITE\")");
Config cfg("qpe");
cfg.setGroup("Volume");
cfg.writeEntry("VolumePercent", QString::number( vol ));
QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false;
- qWarning("changing output vol %d", vol);
+ owarn << "changing output vol " << vol << "" << oendl;
}
::close(fd);
}
void Device::changedInVolume(int vol ) {
int level = (vol << 8) + vol;
@@ -108,13 +108,13 @@ void Device::changedInVolume(int vol ) {
if(ioctl(fd, MIXER_WRITE(SOUND_MIXER_MIC), &level) == -1)
perror("ioctl(\"MIXER_IN_WRITE\")");
Config cfg("qpe");
cfg.setGroup("Volume");
cfg.writeEntry("Mic", QString::number(vol ));
QCopEnvelope( "QPE/System", "micChange(bool)" ) << false;
- qWarning("changing input volume %d", vol);
+ owarn << "changing input volume " << vol << "" << oendl;
}
::close(fd);
}
bool Device::selectMicInput() {
@@ -146,28 +146,28 @@ exit(1);
switch (pid = fork()) {
case -1:
perror("The fork failed!");
break;
case 0: {
*/
-qDebug("Opening %s",dspstr);
+odebug << "Opening " << dspstr << "" << oendl;
if (( sd = ::open( dspstr, flags)) == -1) {
perror("open(\"/dev/dsp\")");
QString errorMsg="Could not open audio device\n /dev/dsp\n"
+(QString)strerror(errno);
- qDebug("XXXXXXXXXXXXXXXXXXXXXXX "+errorMsg);
+ odebug << "XXXXXXXXXXXXXXXXXXXXXXX "+errorMsg << oendl;
return -1;
}
-qDebug("Opening mixer");
+odebug << "Opening mixer" << oendl;
int mixerHandle=0;
if (( mixerHandle = open("/dev/mixer",O_RDWR))<0) {
perror("open(\"/dev/mixer\")");
QString errorMsg="Could not open audio device\n /dev/dsp\n"
+(QString)strerror(errno);
- qDebug("XXXXXXXXXXXXXXXXXXXXXX "+errorMsg);
+ odebug << "XXXXXXXXXXXXXXXXXXXXXX "+errorMsg << oendl;
}
if(ioctl(sd,SNDCTL_DSP_RESET,0)<0){
perror("ioctl RESET");
}
// sprintf(message, "%d", sd);
@@ -177,13 +177,13 @@ qDebug("Opening mixer");
f1.writeBlock(message, strlen(message));
f1.close();
*/
/* close(pipefd[0]);
write(pipefd[1], message, sizeof(message));
close(pipefd[1]);
- // qDebug("%d",soundDevice->sd );
+ // odebug << "" << soundDevice->sd << "" << oendl;
_exit(0);
}
default:
// pid greater than zero is parent getting the child's pid
printf("Child's pid is %d\n",pid);
QString s;
@@ -203,19 +203,19 @@ qDebug("Opening mixer");
// for(int f=0; f < t.atEnd() ;f++) {
s = t.readLine();
// }
*/
// bool ok;
// sd = s.toInt(&ok, 10);
-// qDebug("<<<<<<<<<<<<<>>>>>>>>>>>>"+s);
+// odebug << "<<<<<<<<<<<<<>>>>>>>>>>>>"+s << oendl;
// f2.close();
// }
::close(mixerHandle );
-// qDebug("open device %s", dspstr);
-// qDebug("success! %d",sd);
+// odebug << "open device " << dspstr << "" << oendl;
+// odebug << "success! " << sd << "" << oendl;
return sd;
}
bool Device::closeDevice( bool) {
// if(b) {//close now
// if (ioctl( sd, SNDCTL_DSP_RESET, 0) == -1) {
@@ -227,38 +227,38 @@ bool Device::closeDevice( bool) {
// }
// }
::close( sd); //close sound device
// sdfd=0;
// sd=0;
-// qDebug("closed dsp");
+// odebug << "closed dsp" << oendl;
return true;
}
bool Device::setDeviceFormat( int form) {
- qDebug("set device res %d %d", form, sd);
+ odebug << "set device res " << form << " " << sd << "" << oendl;
if (ioctl( sd, SNDCTL_DSP_SETFMT, &form)==-1) { //set format
perror("ioctl(\"SNDCTL_DSP_SETFMT\")");
return false;
}
devRes=form;
return true;
}
bool Device::setDeviceChannels( int ch) {
- qDebug("set channels %d %d", ch, sd);
+ odebug << "set channels " << ch << " " << sd << "" << oendl;
if (ioctl( sd, SNDCTL_DSP_CHANNELS, &ch)==-1) {
perror("ioctl(\"SNDCTL_DSP_CHANNELS\")");
return false;
}
devCh=ch;
return true;
}
bool Device::setDeviceRate( int rate) {
- qDebug("set rate %d %d", rate, sd);
+ odebug << "set rate " << rate << " " << sd << "" << oendl;
if (ioctl( sd, SNDCTL_DSP_SPEED, &rate) == -1) {
perror("ioctl(\"SNDCTL_DSP_SPEED\")");
return false;
}
devRate=rate;
@@ -315,15 +315,15 @@ int Device::getDeviceChannels() {
}
int Device::getDeviceFragSize() {
int frag_size;
if (ioctl( sd, SNDCTL_DSP_GETBLKSIZE, &frag_size) == -1) {
- qDebug("no fragsize");
+ odebug << "no fragsize" << oendl;
} else {
- qDebug("driver says frag size is %d", frag_size);
+ odebug << "driver says frag size is " << frag_size << "" << oendl;
}
return frag_size;
}
bool Device::setFragSize(int frag) {
if (ioctl(sd, SNDCTL_DSP_SETFRAGMENT, &frag)) {
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
@@ -6,29 +6,34 @@
** This file is part of an example program for Qt. This example
** program may be used, distributed and modified without limitation.
**
*****************************************************************************/
#include "helpwindow.h"
-#include <qlayout.h>
-#include <qtoolbar.h>
+/* OPIE */
+#include <opie2/odebug.h>
#include <qpe/resource.h>
+using namespace Opie::Core;
+/* QT */
+#include <qlayout.h>
+#include <qtoolbar.h>
#include <qaction.h>
#include <qmenubar.h>
+/* STD */
#include <ctype.h>
HelpWindow::HelpWindow( const QString& home_, const QString& _path, QWidget* parent, const char *name )
: QMainWindow( parent, name, WDestructiveClose ), pathCombo( 0 ), selectedURL()
{
QGridLayout *layout = new QGridLayout( this );
layout->setSpacing( 2);
layout->setMargin( 2);
- qDebug(_path);
+ odebug << _path << oendl;
browser = new QTextBrowser( this );
QStringList Strlist;
Strlist.append( home_);
browser->mimeSourceFactory()->setFilePath( Strlist );
browser->setFrameStyle( QFrame::Panel | QFrame::Sunken );
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,9 +1,7 @@
-#CONFIG = qt warn_on pdaudio
-CONFIG = qt warn_on opie
-#CONFIG = qt warn_on quick-app
+CONFIG = qt warn_on
HEADERS = adpcm.h \
pixmaps.h \
helpwindow.h \
qtrec.h \
device.h \
wavFile.h \
@@ -26,13 +24,13 @@ contains(CONFIG, pdaudio) {
DEFINES += THREADED
TARGET = qperec
# DESTDIR=$(QPEDIR)/bin
}
-contains(CONFIG, opie) {
+!contains(CONFIG, pdaudio) {
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
DESTDIR=$(OPIEDIR)/bin
LIBS += -lqpe -lopiecore2 -lpthread
TARGET = opierec
include ( $(OPIEDIR)/include.pro )
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
@@ -5,42 +5,41 @@
****************************************************************************/
#define DEV_VERSION
#include "pixmaps.h"
#include "qtrec.h"
#include "waveform.h"
-
-#include <pthread.h>
-
extern "C" {
#include "adpcm.h"
}
-#include <sys/soundcard.h>
-
+/* OPIE */
+#include <opie2/odebug.h>
#include <qpe/config.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/qpeapplication.h>
#include <qpe/resource.h>
#include <qpe/storage.h>
+using namespace Opie::Core;
+/* QT */
#include <qcheckbox.h>
#include <qcombobox.h>
-//#include <qdatetime.h>
#include <qdir.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qlistview.h>
#include <qmessagebox.h>
#include <qpopupmenu.h>
#include <qpushbutton.h>
#include <qslider.h>
#include <qtabwidget.h>
#include <qtimer.h>
+/* STD */
#include <errno.h>
#include <fcntl.h>
#include <math.h>
#include <mntent.h>
#include <stdio.h>
#include <stdlib.h>
@@ -50,13 +49,13 @@ extern "C" {
#include <sys/time.h>
#include <sys/types.h>
#include <sys/vfs.h>
#include <unistd.h>
#include <sys/wait.h>
#include <sys/signal.h>
-
+#include <pthread.h>
#ifdef PDAUDIO //ALSA
#include <alsa/asoundlib.h>
static int deviceSampleRates[8] = { 32000, 44100, 48000, 88200, 96000, 176400, 192000, -1 };
static int deviceBitRates[] = { 8, 16, 24, 32, -1 };
#else //OSS
@@ -133,43 +132,43 @@ void quickRec()
bytesWritten = 0;
number = 0;
QString num;
int level = 0;
int threshold = 0;
// int bits = filePara.resolution;
-// qDebug("bits %d", bits);
+// odebug << "bits " << bits << "" << oendl;
if( filePara.resolution == 16 ) { //AFMT_S16_LE)
-// qDebug("AFMT_S16_LE size %d", filePara.SecondsToRecord);
-// qDebug("samples to record %d", filePara.samplesToRecord);
-// qDebug("%d", filePara.sd);
+// odebug << "AFMT_S16_LE size " << filePara.SecondsToRecord << "" << oendl;
+// odebug << "samples to record " << filePara.samplesToRecord << "" << oendl;
+// odebug << "" << filePara.sd << "" << oendl;
level = 7;
threshold = 0;
if( filePara.format == WAVE_FORMAT_DVI_ADPCM) {
-// qDebug("start recording WAVE_FORMAT_DVI_ADPCM");
+// odebug << "start recording WAVE_FORMAT_DVI_ADPCM" << oendl;
// <<<<<<<<<<<<<<<<<<<<<<<<<<< WAVE_FORMAT_DVI_ADPCM >>>>>>>>>>>>>>>>>>>>>>
char abuf[ BUFSIZE/2 ];
short sbuf[ BUFSIZE ];
short sbuf2[ BUFSIZE ];
memset( abuf, 0, BUFSIZE/2);
memset( sbuf, 0, BUFSIZE);
memset( sbuf2, 0, BUFSIZE);
for(;;) {
if ( stopped) {
-// qDebug("quickRec:: stopped");
+// odebug << "quickRec:: stopped" << oendl;
break;
}
// number=::read( filePara.sd, sbuf, BUFSIZE);
number = soundDevice ->devRead( filePara.sd, sbuf, BUFSIZE);
if(number <= 0) {
perror("recording error ");
- qDebug( "%s %d", filePara.fileName, number);
+ odebug << "" << filePara.fileName << " " << number << "" << oendl;
stopped = true;
return;
}
//if(stereo == 2) {
// adpcm_coder( sbuf2, abuf, number/2, &encoder_state);
adpcm_coder( sbuf, abuf, number/2, &encoder_state);
@@ -189,31 +188,31 @@ void quickRec()
stopped = true;
break;
}
}
} else {
// <<<<<<<<<<<<<<<<<<<<<<<<<<< WAVE_FORMAT_PCM >>>>>>>>>>>>>>>>>>>>>>
- qDebug("start recording WAVE_FORMAT_PCM");
+ odebug << "start recording WAVE_FORMAT_PCM" << oendl;
short inbuffer[ BUFSIZE ], outbuffer[ BUFSIZE ];
memset( inbuffer, 0, BUFSIZE);
memset( outbuffer, 0, BUFSIZE);
for(;;) {
if ( stopped) {
- qDebug("quickRec:: stopped");
+ odebug << "quickRec:: stopped" << oendl;
stopped = true;
break; // stop if playing was set to false
return;
}
number = soundDevice->devRead( filePara.sd, (short *)inbuffer, BUFSIZE);
waveform->newSamples( inbuffer, number );
if( number <= 0) {
perror( "recording error ");
- qDebug( filePara.fileName);
+ odebug << filePara.fileName << oendl;
stopped = true;
return;
}
bytesWritten = ::write( filePara.fd , inbuffer, number);
@@ -247,13 +246,13 @@ void quickRec()
unsigned char unsigned_inbuffer[ BUFSIZE ], unsigned_outbuffer[ BUFSIZE ];
memset( unsigned_inbuffer, 0, BUFSIZE);
memset( unsigned_outbuffer, 0, BUFSIZE);
for(;;) {
if ( stopped) {
- qDebug("quickRec:: stopped");
+ odebug << "quickRec:: stopped" << oendl;
break; // stop if playing was set to false
}
number = ::read( filePara.sd, unsigned_inbuffer, BUFSIZE);
bytesWritten = ::write( filePara.fd , unsigned_inbuffer, number);
@@ -370,13 +369,13 @@ void playIt()
// timeString.sprintf("%.2f",filePara.numberOfRecordedSeconds);
// timeLabel->setText( timeString + tr(" seconds"));
qApp->processEvents();
if( /*total >= filePara.numberSamples || */ bytesWritten == 0) {
- qWarning("Jane! Stop this crazy thing!");
+ owarn << "Jane! Stop this crazy thing!" << oendl;
stopped = true;
// playing = false;
break;
}
}
printf("\nplaying number %d, bytes %d, total %d\r",number, bytesWritten, total);
@@ -715,13 +714,13 @@ void QtRec::initIconView() {
Config cfg("OpieRec");
cfg.setGroup("Sounds");
QString temp;
QPixmap image0( ( const char** ) image0_data );
int nFiles = cfg.readNumEntry("NumberofFiles",0);
-// qDebug("init number of files %d", nFiles);
+// odebug << "init number of files " << nFiles << "" << oendl;
for(int i=1;i<= nFiles;i++) {
QListViewItem * item;
QString fileS, mediaLocation, fileDate, filePath;
@@ -857,13 +856,13 @@ void QtRec::initConfig() {
cofg.setGroup( "Volume");
outMuteCheckBox->setChecked( cofg.readBoolEntry( "Mute",0));
inMuteCheckBox->setChecked( cofg.readBoolEntry( "MicMute",0));
}
void QtRec::stop() {
- qWarning("STOP");
+ owarn << "STOP" << oendl;
setRecordButton(false);
if( !recording)
endPlaying();
else
endRecording();
@@ -919,38 +918,38 @@ bool QtRec::rec() { //record
// qDebug( "<<<<<<<Device bits %d, device rate %d, device channels %d",
// soundDevice->getDeviceBits(),
// soundDevice->getDeviceRate(),
// soundDevice->getDeviceChannels());
//filePara.sampleRate = cfg.readNumEntry("samplerate", 22050);
-// qDebug("sample rate is %d", filePara.sampleRate);
+// odebug << "sample rate is " << filePara.sampleRate << "" << oendl;
filePara.SecondsToRecord = getCurrentSizeLimit();
-// qDebug("size limit %d sec", filePara.SecondsToRecord);
+// odebug << "size limit " << filePara.SecondsToRecord << " sec" << oendl;
int diskSize = checkDiskSpace( (const QString &) wavFile->trackName());
if( filePara.SecondsToRecord == 0) {
fileSize = diskSize;
} else if( filePara.format == WAVE_FORMAT_PCM) {
-// qDebug("WAVE_FORMAT_PCM");
+// odebug << "WAVE_FORMAT_PCM" << oendl;
fileSize = (filePara.SecondsToRecord ) * filePara.channels
* filePara.sampleRate * ( filePara.resolution / 8) + 1000;
} else {
-// qDebug("WAVE_FORMAT_DVI_ADPCM");
+// odebug << "WAVE_FORMAT_DVI_ADPCM" << oendl;
fileSize = ((filePara.SecondsToRecord) * filePara.channels
* filePara.sampleRate * ( filePara.resolution / 8) ) / 4 + 250;
}
filePara.samplesToRecord = fileSize;
qDebug("filesize should be %d, bits %d, rate %d",
filePara.samplesToRecord, filePara.resolution, filePara.sampleRate);
if( paused) {
paused = false;
}
// else {
- qDebug("Setting timeslider %d", filePara.samplesToRecord);
+ odebug << "Setting timeslider " << filePara.samplesToRecord << "" << oendl;
// if(fileSize != 0)
timeSlider->setRange(0, filePara.samplesToRecord);
// }
if( diskSize < fileSize/1024) {
QMessageBox::warning(this,
@@ -963,13 +962,13 @@ bool QtRec::rec() { //record
QString msg;
msg.sprintf("%d, %d, %d", filePara.sampleRate, filePara.channels, filePara.resolution);
#ifdef DEV_VERSION
setCaption( msg);
#endif
filePara.fileName=currentFile.latin1();
- qDebug("Start recording thread");
+ odebug << "Start recording thread" << oendl;
stopped = false;
#ifdef THREADED
pthread_t thread1;
pthread_create( &thread1, NULL, (void * (*)(void *))quickRec, NULL/* &*/);
#endif
@@ -1007,19 +1006,19 @@ void QtRec::thisTab(QWidget* widg) {
update();
}
}
void QtRec::getOutVol( ) {
filePara.outVol = soundDevice->getOutVolume();
-// qDebug("out vol %d", filePara.outVol);
+// odebug << "out vol " << filePara.outVol << "" << oendl;
OutputSlider->setValue( -filePara.outVol);
}
void QtRec::getInVol() {
filePara.inVol = soundDevice->getInVolume();
-// qDebug("in vol %d", filePara.inVol);
+// odebug << "in vol " << filePara.inVol << "" << oendl;
InputSlider->setValue( -filePara.inVol);
}
void QtRec::changedOutVolume() {
soundDevice->changedOutVolume( -OutputSlider->value());
}
@@ -1087,17 +1086,17 @@ bool QtRec::setupAudio( bool b) {
sampleformat = AFMT_S16_LE;
else
sampleformat = AFMT_U8;
if( !compressionCheckBox->isChecked()) {
filePara.format = WAVE_FORMAT_PCM;
-// qDebug("WAVE_FORMAT_PCM");
+// odebug << "WAVE_FORMAT_PCM" << oendl;
} else {
filePara.format = WAVE_FORMAT_DVI_ADPCM;
sampleformat = AFMT_S16_LE;
-// qDebug("WAVE_FORMAT_DVI_ADPCM");
+// odebug << "WAVE_FORMAT_DVI_ADPCM" << oendl;
}
#endif
stereo = filePara.channels;
// filePara.sampleRate = sampleRateComboBox->currentText().toInt( &ok,10);//44100;
flags= O_RDWR;
@@ -1107,21 +1106,21 @@ bool QtRec::setupAudio( bool b) {
dspString = hwcfg.readEntry( "Audio", DSPSTRIN);
mixerString = hwcfg.readEntry( "Mixer", DSPSTRMIXERIN);
recording = true;
}
// if(soundDevice) delete soundDevice;
- qDebug("<<<<<<<<<<<<<<<<<<<open dsp %d %d %d", filePara.sampleRate, filePara.channels, sampleformat);
- qWarning("change waveform settings");
+ odebug << "<<<<<<<<<<<<<<<<<<<open dsp " << filePara.sampleRate << " " << filePara.channels << " " << sampleformat << "" << oendl;
+ owarn << "change waveform settings" << oendl;
waveform->changeSettings( filePara.sampleRate, filePara.channels );
soundDevice = new Device( this, dspString, mixerString, b);
// soundDevice->openDsp();
soundDevice->reset();
- qDebug("device has been made %d", soundDevice->sd);
+ odebug << "device has been made " << soundDevice->sd << "" << oendl;
////////////////// <<<<<<<<<<<<>>>>>>>>>>>>
soundDevice->setDeviceFormat( sampleformat);
soundDevice->setDeviceChannels( filePara.channels);
soundDevice->setDeviceRate( filePara.sampleRate);
soundDevice->getDeviceFragSize();
@@ -1146,13 +1145,13 @@ bool QtRec::setupAudio( bool b) {
return true;
}
bool QtRec::setUpFile() { //setup file for recording
-// qDebug("Setting up wavfile");
+// odebug << "Setting up wavfile" << oendl;
// if(wavFile) delete wavFile;
wavFile = new WavFile( this, (const QString &)"",
true,
filePara.sampleRate,
filePara.channels,
filePara.resolution,
@@ -1179,13 +1178,13 @@ bool QtRec::doPlay() {
}
playing = true;
stopped = false;
recording = false;
QString num;
- qDebug( "Play number of samples %d", filePara.numberSamples);
+ odebug << "Play number of samples " << filePara.numberSamples << "" << oendl;
// timeSlider->setRange( 0, filePara.numberSamples);
timeString.sprintf("%f", filePara.numberOfRecordedSeconds);
timeLabel->setText( timeString+ tr(" seconds"));
@@ -1231,13 +1230,13 @@ void QtRec::changesamplerateCombo(int i) {
cfg.setGroup("Settings");
int rate=0;
bool ok;
rate = sampleRateComboBox->text(i).toInt(&ok, 10);
cfg.writeEntry( "samplerate",rate);
filePara.sampleRate=rate;
- qDebug( "Change sample rate %d", rate);
+ odebug << "Change sample rate " << rate << "" << oendl;
cfg.write();
}
void QtRec::changeDirCombo(int index) {
Config cfg("OpieRec");
@@ -1251,13 +1250,13 @@ void QtRec::changeDirCombo(int index) {
for( ; it.current(); ++it ){
if( sName == (*it)->name()+" "+ (*it)->path() ||
(*it)->name() == sName ) {
const QString path = (*it)->path();
recDir = path;
cfg.writeEntry("directory", recDir);
- qDebug("new rec dir "+recDir);
+ odebug << "new rec dir "+recDir << oendl;
}
}
cfg.write();
}
@@ -1371,13 +1370,13 @@ void QtRec::keyPressEvent( QKeyEvent *e) {
// stop();
break;
case Key_Down:
// newSound();
break;
case Key_Left: {
- qDebug("rewinding");
+ odebug << "rewinding" << oendl;
if( !e->isAutoRepeat())
rewindPressed();
}
break;
case Key_Right: {
if( !e->isAutoRepeat())
@@ -1425,25 +1424,25 @@ void QtRec::keyReleaseEvent( QKeyEvent *e) {
break;
case Key_Delete:
deleteSound();
break;
case Key_Up:
// stop();
- qDebug("Up");
+ odebug << "Up" << oendl;
break;
case Key_Down:
// start();
- // qDebug("Down");
+ // odebug << "Down" << oendl;
// newSound();
break;
case Key_Left:
- qDebug("Left");
+ odebug << "Left" << oendl;
rewindReleased();
break;
case Key_Right:
- qDebug("Right");
+ odebug << "Right" << oendl;
FastforwardReleased();
break;
}
}
void QtRec::endRecording() {
@@ -1472,17 +1471,17 @@ void QtRec::endRecording() {
filePara.fd=0;
if( wavFile->isTempFile()) {
// move tmp file to regular file
QString cmd;
cmd.sprintf("mv "+ wavFile->trackName() + " " + wavFile->currentFileName);
-// qDebug("moving tmp file to "+currentFileName);
+// odebug << "moving tmp file to "+currentFileName << oendl;
system( cmd.latin1());
}
- qDebug("Just moved " + wavFile->currentFileName);
+ odebug << "Just moved " + wavFile->currentFileName << oendl;
Config cfg("OpieRec");
cfg.setGroup("Sounds");
int nFiles = cfg.readNumEntry( "NumberofFiles",0);
currentFile = QFileInfo( wavFile->currentFileName).fileName();
@@ -1492,16 +1491,16 @@ void QtRec::endRecording() {
cfg.writeEntry( QString::number( nFiles + 1), currentFile);
cfg.writeEntry( currentFile, wavFile->currentFileName);
QString time;
time.sprintf("%.2f", filePara.numberOfRecordedSeconds);
cfg.writeEntry( wavFile->currentFileName, time );
-// qDebug("writing config numberOfRecordedSeconds "+time);
+// odebug << "writing config numberOfRecordedSeconds "+time << oendl;
cfg.write();
- qDebug("finished recording");
+ odebug << "finished recording" << oendl;
timeLabel->setText("");
}
if(soundDevice) delete soundDevice;
timeSlider->setValue(0);
@@ -1513,36 +1512,36 @@ void QtRec::endPlaying() {
monitoring = false;
recording = false;
playing = false;
stopped = true;
waveform->reset();
// errorStop();
-// qDebug("end playing");
+// odebug << "end playing" << oendl;
setRecordButton( false);
toBeginningButton->setEnabled( true);
toEndButton->setEnabled( true);
if(autoMute)
doMute( true);
soundDevice->closeDevice( false);
soundDevice->sd = -1;
// if(soundDevice) delete soundDevice;
-// qDebug("file and sound device closed");
+// odebug << "file and sound device closed" << oendl;
timeLabel->setText("");
total = 0;
filePara.numberSamples = 0;
filePara.sd = -1;
// wavFile->closeFile();
filePara.fd = 0;
// if(wavFile) delete wavFile; //this crashes
-// qDebug("track closed");
+// odebug << "track closed" << oendl;
killTimers();
- qWarning("reset slider");
+ owarn << "reset slider" << oendl;
timeSlider->setValue(0);
if(soundDevice) delete soundDevice;
}
@@ -1558,13 +1557,13 @@ bool QtRec::openPlayFile() {
Config cfg("OpieRec");
cfg.setGroup("Sounds");
int nFiles = cfg.readNumEntry( "NumberofFiles", 0);
for(int i=0;i<nFiles+1;i++) { //look for file
if( cfg.readEntry( QString::number(i),"").find( currentFile,0,true) != -1) {
currentFileName = cfg.readEntry( currentFile, "" );
- qDebug("opening for play: " + currentFileName);
+ odebug << "opening for play: " + currentFileName << oendl;
}
}
wavFile = new WavFile(this,
currentFileName,
false);
filePara.fd = wavFile->wavHandle();
@@ -1583,16 +1582,16 @@ bool QtRec::openPlayFile() {
filePara.sampleRate = wavFile->getSampleRate();
filePara.resolution = wavFile->getResolution();
filePara.channels = wavFile->getChannels();
timeSlider->setPageStep(1);
monitoring = true;
- qDebug("file %d, samples %d %d", filePara.fd, filePara.numberSamples, filePara.sampleRate);
+ odebug << "file " << filePara.fd << ", samples " << filePara.numberSamples << " " << filePara.sampleRate << "" << oendl;
int sec = (int) (( filePara.numberSamples / filePara.sampleRate) / filePara.channels) / ( filePara.channels*( filePara.resolution/8));
- qWarning("seconds %d", sec);
+ owarn << "seconds " << sec << "" << oendl;
timeSlider->setRange(0, filePara.numberSamples );
}
return true;
}
@@ -1687,25 +1686,25 @@ void QtRec::doRename() {
renameBox->setFocus();
renameBox->show();
}
void QtRec::okRename() {
- qDebug(renameBox->text());
+ odebug << renameBox->text() << oendl;
QString filename = renameBox->text();
cancelRename();
if( ListView1->currentItem() == NULL)
return;
Config cfg("OpieRec");
cfg.setGroup("Sounds");
QString file = ListView1->currentItem()->text(0);
- qDebug("filename is " + filename);
+ odebug << "filename is " + filename << oendl;
int nFiles = cfg.readNumEntry("NumberofFiles",0);
for(int i=0;i<nFiles+1;i++) { //look for file
if( cfg.readEntry( QString::number(i),"").find(file,0,true) != -1) {
@@ -1770,13 +1769,13 @@ void QtRec::doVolMuting(bool b) {
cfg.writeEntry( "Mute",b);
cfg.write();
QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << b;
}
void QtRec::doMicMuting(bool b) {
- // qDebug("mic mute");
+ // odebug << "mic mute" << oendl;
Config cfg( "qpe" );
cfg. setGroup( "Volume" );
cfg.writeEntry( "MicMute",b);
cfg.write();
QCopEnvelope( "QPE/System", "micChange(bool)" ) << b;
}
@@ -1826,13 +1825,13 @@ long QtRec::checkDiskSpace(const QString &path) {
// long f_files; /* Total number of file nodes */
// long f_ffree; /* Count of free file nodes */
// char f_fname[6]; /* Volumename */
// char f_fpack[6]; /* Pack name */
void QtRec::receive( const QCString &msg, const QByteArray & ) {
- qDebug("Voicerecord received message "+msg);
+ odebug << "Voicerecord received message "+msg << oendl;
}
///////////////////////////// timerEvent
void QtRec::timerEvent( QTimerEvent * ) {
@@ -1851,13 +1850,13 @@ void QtRec::timerEvent( QTimerEvent * ) {
}
if( recording && filePara.SecondsToRecord < secCount && filePara.SecondsToRecord != 0) {
stop();
}
- qDebug( "%d", secCount );
+ odebug << "" << secCount << "" << oendl;
QString timeString;
#ifdef DEV_VERSION
QString msg;
msg.sprintf("%d, %d, %d", filePara.sampleRate, filePara.channels, filePara.resolution);
setCaption( msg +" :: "+QString::number(secCount));
#endif
@@ -1867,13 +1866,13 @@ void QtRec::timerEvent( QTimerEvent * ) {
secCount++;
}
void QtRec::changeTimeSlider(int index) {
if( ListView1->currentItem() == 0 || !wavFile->track.isOpen()) return;
- // qDebug("Slider moved to %d",index);
+ // odebug << "Slider moved to " << index << "" << oendl;
paused = true;
stopped = true;
sliderPos=index;
QString timeString;
@@ -1882,22 +1881,22 @@ void QtRec::changeTimeSlider(int index) {
secCount = (int)filePara.numberOfRecordedSeconds;
timeLabel->setText( timeString + tr(" seconds"));
}
void QtRec::timeSliderPressed() {
if( ListView1->currentItem() == 0) return;
- // qDebug("slider pressed");
+ // odebug << "slider pressed" << oendl;
paused = true;
stopped = true;
}
void QtRec::timeSliderReleased() {
if( ListView1->currentItem() == 0) return;
sliderPos = timeSlider->value();
- // qDebug("slider released %d", sliderPos);
+ // odebug << "slider released " << sliderPos << "" << oendl;
stopped = false;
int newPos = lseek( filePara.fd, sliderPos, SEEK_SET);
total = newPos*4;
filePara.numberOfRecordedSeconds = (float)sliderPos / (float)filePara.sampleRate * (float)2;
doPlay();
@@ -1921,13 +1920,13 @@ void QtRec::rewindPressed() {
void QtRec::rewindTimerTimeout() {
int sliderValue = timeSlider->value();
sliderValue = sliderValue - ( filePara.numberSamples / 100);
// if(toBeginningButton->isDown())
timeSlider->setValue( sliderValue ) ;
- // qDebug("%d", sliderValue);
+ // odebug << "" << sliderValue << "" << oendl;
QString timeString;
filePara.numberOfRecordedSeconds = (float)sliderValue / (float)filePara.sampleRate * (float)2;
timeString.sprintf( "%.2f", filePara.numberOfRecordedSeconds);
timeLabel->setText( timeString+ tr(" seconds"));
}
@@ -1935,13 +1934,13 @@ void QtRec::rewindReleased() {
rewindTimer->stop();
if( wavFile->track.isOpen()) {
sliderPos=timeSlider->value();
stopped = false;
int newPos = lseek( filePara.fd, sliderPos, SEEK_SET);
total = newPos * 4;
- // qDebug("rewind released %d", total);
+ // odebug << "rewind released " << total << "" << oendl;
startTimer( 1000);
doPlay();
}
}
void QtRec::FastforwardPressed() {
@@ -1999,13 +1998,13 @@ QString QtRec::getStorage(const QString &fileName) {
const QString disk = ( *it)->disk();
if( fileName.find( path,0,true) != -1)
storage = name;
// const QString options = (*it)->options();
// if( name.find( tr("Internal"),0,true) == -1) {
// storageComboBox->insertItem( name +" -> "+disk);
- // qDebug(name);
+ // odebug << name << oendl;
}
return storage;
// struct mntent *me;
// // if(fileName == "/etc/mtab") {
// FILE *mntfp = setmntent( fileName.latin1(), "r" );
// if ( mntfp ) {
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,33 +1,36 @@
//wavFile.cpp
#include "wavFile.h"
#include "qtrec.h"
+/* OPIE */
+#include <opie2/odebug.h>
+#include <qpe/config.h>
+using namespace Opie::Core;
+
+/* QT */
#include <qmessagebox.h>
#include <qdir.h>
-#include <qpe/config.h>
-
+/* STD */
#include <errno.h>
-
#include <sys/time.h>
#include <sys/types.h>
#include <sys/vfs.h>
-
#include <fcntl.h>
#include <math.h>
#include <mntent.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
WavFile::WavFile( QObject * parent,const QString &fileName, bool makeNwFile, int sampleRate,
int channels, int resolution, int format )
: QObject( parent)
{
-//qDebug("new wave file");
+//odebug << "new wave file" << oendl;
bool b = makeNwFile;
wavSampleRate=sampleRate;
wavFormat=format;
wavChannels=channels;
wavResolution=resolution;
useTmpFile=false;
@@ -37,13 +40,13 @@ WavFile::WavFile( QObject * parent,const QString &fileName, bool makeNwFile, int
openFile(fileName);
}
}
bool WavFile::newFile() {
-// qDebug("Set up new file");
+// odebug << "Set up new file" << oendl;
Config cfg("OpieRec");
cfg.setGroup("Settings");
currentFileName=cfg.readEntry("directory",QDir::homeDirPath());
QString date;
QDateTime dt = QDateTime::currentDateTime();
@@ -57,13 +60,13 @@ bool WavFile::newFile() {
if(currentFileName.right(1).find("/",0,true) == -1)
currentFileName += "/" + date;
else
currentFileName += date;
currentFileName+=".wav";
-// qDebug("set up file for recording: "+currentFileName);
+// odebug << "set up file for recording: "+currentFileName << oendl;
char pointer[] = "/tmp/opierec-XXXXXX";
int fd = 0;
if( currentFileName.find("/mnt",0,true) == -1
&& currentFileName.find("/tmp",0,true) == -1 ) {
// if destination file is most likely in flash (assuming jffs2)
@@ -72,23 +75,23 @@ bool WavFile::newFile() {
useTmpFile = true;
if(( fd = mkstemp( pointer)) < 0 ) {
perror("mkstemp failed");
return false;
}
-// qDebug("Opening tmp file %s",pointer);
+// odebug << "Opening tmp file " << pointer << "" << oendl;
track.setName( pointer);
} else { //just use regular file.. no moving
useTmpFile = false;
track.setName( currentFileName);
}
if(!track.open( IO_ReadWrite | IO_Truncate)) {
QString errorMsg=(QString)strerror(errno);
- qDebug(errorMsg);
+ odebug << errorMsg << oendl;
QMessageBox::message("Note", "Error opening file.\n" +errorMsg);
return false;
} else {
setWavHeader( track.handle() , &hdr);
}
@@ -103,20 +106,20 @@ WavFile::~WavFile() {
void WavFile::closeFile() {
if(track.isOpen())
track.close();
}
int WavFile::openFile(const QString &currentFileName) {
-// qDebug("open play file "+currentFileName);
+// odebug << "open play file "+currentFileName << oendl;
closeFile();
track.setName(currentFileName);
if(!track.open(IO_ReadOnly)) {
QString errorMsg=(QString)strerror(errno);
- qDebug("<<<<<<<<<<< "+errorMsg+currentFileName);
+ odebug << "<<<<<<<<<<< "+errorMsg+currentFileName << oendl;
QMessageBox::message("Note", "Error opening file.\n" +errorMsg);
return -1;
} else {
parseWavHeader( track.handle());
}
return track.handle();
@@ -128,17 +131,17 @@ bool WavFile::setWavHeader(int fd, wavhdr *hdr) {
strncpy((*hdr).wavID, "WAVE", 4); //WAVE
strncpy((*hdr).fmtID, "fmt ", 4); // fmt
(*hdr).fmtLen = 16; // format length = 16
if( wavFormat == WAVE_FORMAT_PCM) {
(*hdr).fmtTag = 1; // PCM
-// qDebug("set header WAVE_FORMAT_PCM");
+// odebug << "set header WAVE_FORMAT_PCM" << oendl;
}
else {
(*hdr).fmtTag = WAVE_FORMAT_DVI_ADPCM; //intel ADPCM
- // qDebug("set header WAVE_FORMAT_DVI_ADPCM");
+ // odebug << "set header WAVE_FORMAT_DVI_ADPCM" << oendl;
}
// (*hdr).nChannels = 1;//filePara.channels;// ? 2 : 1*/; // channels
(*hdr).nChannels = wavChannels;// ? 2 : 1*/; // channels
(*hdr).sampleRate = wavSampleRate; //samples per second
@@ -157,112 +160,112 @@ bool WavFile::setWavHeader(int fd, wavhdr *hdr) {
bool WavFile::adjustHeaders(int fd, int total) {
lseek(fd, 4, SEEK_SET);
int i = total + 36;
write( fd, &i, sizeof(i));
lseek( fd, 40, SEEK_SET);
write( fd, &total, sizeof(total));
- qDebug("adjusting header %d", total);
+ odebug << "adjusting header " << total << "" << oendl;
return true;
}
int WavFile::parseWavHeader(int fd) {
- qDebug("Parsing wav header");
+ odebug << "Parsing wav header" << oendl;
char string[4];
int found;
short fmt;
unsigned short ch, bitrate;
unsigned long samplerrate, longdata;
if (read(fd, string, 4) < 4) {
- qDebug(" Could not read from sound file.\n");
+ odebug << " Could not read from sound file.\n" << oendl;
return -1;
}
if (strncmp(string, "RIFF", 4)) {
- qDebug(" not a valid WAV file.\n");
+ odebug << " not a valid WAV file.\n" << oendl;
return -1;
}
lseek(fd, 4, SEEK_CUR);
if (read(fd, string, 4) < 4) {
- qDebug("Could not read from sound file.\n");
+ odebug << "Could not read from sound file.\n" << oendl;
return -1;
}
if (strncmp(string, "WAVE", 4)) {
- qDebug("not a valid WAV file.\n");
+ odebug << "not a valid WAV file.\n" << oendl;
return -1;
}
found = 0;
while (!found) {
if (read(fd, string, 4) < 4) {
- qDebug("Could not read from sound file.\n");
+ odebug << "Could not read from sound file.\n" << oendl;
return -1;
}
if (strncmp(string, "fmt ", 4)) {
if (read(fd, &longdata, 4) < 4) {
- qDebug("Could not read from sound file.\n");
+ odebug << "Could not read from sound file.\n" << oendl;
return -1;
}
lseek(fd, longdata, SEEK_CUR);
} else {
lseek(fd, 4, SEEK_CUR);
if (read(fd, &fmt, 2) < 2) {
- qDebug("Could not read format chunk.\n");
+ odebug << "Could not read format chunk.\n" << oendl;
return -1;
}
if (fmt != WAVE_FORMAT_PCM && fmt != WAVE_FORMAT_DVI_ADPCM) {
qDebug("Wave file contains unknown format."
" Unable to continue.\n");
return -1;
}
wavFormat = fmt;
// compressionFormat=fmt;
- qDebug("compressionFormat is %d", fmt);
+ odebug << "compressionFormat is " << fmt << "" << oendl;
if (read(fd, &ch, 2) < 2) {
- qDebug("Could not read format chunk.\n");
+ odebug << "Could not read format chunk.\n" << oendl;
return -1;
} else {
wavChannels = ch;
- qDebug("File has %d channels", ch);
+ odebug << "File has " << ch << " channels" << oendl;
}
if (read(fd, &samplerrate, 4) < 4) {
- qDebug("Could not read from format chunk.\n");
+ odebug << "Could not read from format chunk.\n" << oendl;
return -1;
} else {
wavSampleRate = samplerrate;
// sampleRate = samplerrate;
- qDebug("File has samplerate of %d",(int) samplerrate);
+ odebug << "File has samplerate of " << (int) samplerrate << "" << oendl;
}
lseek(fd, 6, SEEK_CUR);
if (read(fd, &bitrate, 2) < 2) {
- qDebug("Could not read format chunk.\n");
+ odebug << "Could not read format chunk.\n" << oendl;
return -1;
} else {
wavResolution=bitrate;
// resolution = bitrate;
- qDebug("File has bitrate of %d", bitrate);
+ odebug << "File has bitrate of " << bitrate << "" << oendl;
}
found++;
}
}
found = 0;
while (!found) {
if (read(fd, string, 4) < 4) {
- qDebug("Could not read from sound file.\n");
+ odebug << "Could not read from sound file.\n" << oendl;
return -1;
}
if (strncmp(string, "data", 4)) {
if (read(fd, &longdata, 4)<4) {
- qDebug("Could not read from sound file.\n");
+ odebug << "Could not read from sound file.\n" << oendl;
return -1;
}
lseek(fd, longdata, SEEK_CUR);
} else {
if (read(fd, &longdata, 4) < 4) {
- qDebug("Could not read from sound file.\n");
+ odebug << "Could not read from sound file.\n" << oendl;
return -1;
} else {
wavNumberSamples = longdata;
qDebug("file has length of %d \nlasting %d seconds", (int)longdata,
(int)(( longdata / wavSampleRate) / wavChannels) / ( wavChannels*( wavResolution/8)) );
// wavSeconds = (( longdata / wavSampleRate) / wavChannels) / ( wavChannels*( wavResolution/8));
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
@@ -16,14 +16,18 @@
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "waveform.h"
-#include <qpainter.h>
+/* OPIE */
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+/* QT */
+#include <qpainter.h>
Waveform::Waveform( QWidget *parent, const char *name, WFlags fl )
: QWidget( parent, name, fl )
{
pixmap = 0;
windowSize = 100;
@@ -35,15 +39,15 @@ Waveform::Waveform( QWidget *parent, const char *name, WFlags fl )
}
void Waveform::changeSettings( int frequency, int channels )
{
makePixmap();
-// qWarning("change waveform %d, %d", frequency, channels);
+// owarn << "change waveform " << frequency << ", " << channels << "" << oendl;
samplesPerPixel = frequency * channels / (5 * windowSize);
- qWarning("Waveform::changeSettings %d", samplesPerPixel);
+ owarn << "Waveform::changeSettings " << samplesPerPixel << "" << oendl;
if ( !samplesPerPixel )
samplesPerPixel = 1;
currentValue = 0;
numSamples = 0;
windowPosn = 0;
draw();
@@ -93,13 +97,13 @@ void Waveform::newSamples( const short *buf, int len )
numSamples = 0;
currentValue = 0;
}
}
// Copy the final state back to the object.
-//qWarning("%d, %d, %d", currentValue, numSamples, windowPosn);
+//owarn << "" << currentValue << ", " << numSamples << ", " << windowPosn << "" << oendl;
this->currentValue = currentValue;
this->numSamples = numSamples;
this->windowPosn = windowPosn;
}
diff --git a/noncore/multimedia/powerchord/config.in b/noncore/multimedia/powerchord/config.in
index ab1512b..5db784a 100644
--- a/noncore/multimedia/powerchord/config.in
+++ b/noncore/multimedia/powerchord/config.in
@@ -1,7 +1,7 @@
config POWERCHORD
boolean "opie-powerchord (guitar chord generator and tuning)"
default "n"
- depends ( LIBQPE || LIBQPE-X11 )
- comment "opie-powerchord needs a libqpe"
- depends !(( LIBQPE || LIBQPE-X11 ) )
+ depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE
+ comment "opie-powerchord needs a libqpe and libopiecore2"
+ depends !(( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE )
diff --git a/noncore/multimedia/powerchord/powerchord.pro b/noncore/multimedia/powerchord/powerchord.pro
index 917c88f..f7af6d6 100644
--- a/noncore/multimedia/powerchord/powerchord.pro
+++ b/noncore/multimedia/powerchord/powerchord.pro
@@ -15,13 +15,12 @@ SOURCES = main.cpp \
vumeter.cpp \
gs.cpp gt.cpp \
powerchordbase.cpp
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
-LIBS += -lqpe
-#INTERFACES = powerchordbase.ui
+LIBS += -lqpe -lopiecore2
DESTDIR = $(OPIEDIR)/bin
TARGET = powerchord
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
@@ -4,25 +4,29 @@
** Created: Sun Jan 13 23:05:11 2002
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "powerchordbase.h"
-
#include "fretboard.h"
#include "vumeter.h"
+
+/* OPIE */
+#include <opie2/odebug.h>
+#include <qpe/resource.h>
+using namespace Opie::Core;
+
+/* QT */
#include <qcombobox.h>
#include <qlabel.h>
#include <qlistbox.h>
#include <qpushbutton.h>
#include <qspinbox.h>
#include <qtabwidget.h>
#include <qlayout.h>
#include <qtooltip.h>
-#include <qpe/resource.h>
-
/*
* Constructs a PowerchordBase which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'
*/
PowerchordBase::PowerchordBase( QWidget* parent, const char* name, WFlags fl )
@@ -577,9 +581,9 @@ PowerchordBase::~PowerchordBase()
{
// no need to delete child widgets, Qt does it all for us
}
void PowerchordBase::change_handler()
{
- qWarning( "PowerchordBase::change_handler(): Not implemented yet!" );
+ owarn << "PowerchordBase::change_handler(): Not implemented yet!" << oendl;
}
diff --git a/noncore/multimedia/showimg/ImageFileSelector.cpp b/noncore/multimedia/showimg/ImageFileSelector.cpp
index 79ee925..53cc883 100644
--- a/noncore/multimedia/showimg/ImageFileSelector.cpp
+++ b/noncore/multimedia/showimg/ImageFileSelector.cpp
@@ -1,17 +1,19 @@
+#include "ImageFileSelector.h"
+/* OPIE */
+#include <opie2/odebug.h>
+#include <qpe/qpeapplication.h>
+using namespace Opie::Core;
-#include "qpe/qpeapplication.h"
-
-#include <stdlib.h>
-
-#include <qlabel.h>
+/* QT */
+#include <qlabel.h>
#include <qfileinfo.h>
-#include "ImageFileSelector.h"
-
+/* STD */
+#include <stdlib.h>
ThumbWidget::ThumbWidget(QPixmap p,QString text,const DocLnk& f,QWidget *parent,int w)
: QWidget( parent ),fl(f)
{
setBackgroundMode(NoBackground);
if ( w!=-1 )
@@ -152,13 +154,13 @@ void ImageFileSelector::updateSizes()
background->setMinimumWidth(thumb->visibleWidth());
thumb->updateScrollBars();
}
void ImageFileSelector::reread(bool)
{
-// qDebug("reread");
+// odebug << "reread" << oendl;
ImageFileSelectorItem *item = (ImageFileSelectorItem *)detailed->selectedItem();
QString oldFile;
if ( item )
oldFile = item->file().file();
detailed->clear();
tList.clear();
@@ -218,13 +220,13 @@ void ImageFileSelector::reread(bool)
int ImageFileSelector::fileCount()
{
return count;
}
const DocLnk * ImageFileSelector::selected()
{
- qDebug("image selected");
+ odebug << "image selected" << oendl;
ImageFileSelectorItem *item = (ImageFileSelectorItem *) detailed->selectedItem();
if ( item )
return new DocLnk( item->file() );
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
@@ -23,29 +23,31 @@
//
#include "showimg.h"
#include "ImageFileSelector.h"
#include "settingsdialog.h"
-
+/* OPIE */
+#include <opie2/odebug.h>
#include <opie2/ofiledialog.h>
-
#include <qpe/qpeapplication.h>
#include <qpe/config.h>
#include <qpe/resource.h>
-#include <qtoolbar.h>
+using namespace Opie::Core;
+using namespace Opie::Ui;
+/* QT */
+#include <qtoolbar.h>
#include <qaction.h>
#include <qfiledialog.h>
#include <qmenubar.h>
#include <qspinbox.h>
+/* STD */
#include <math.h>
-
-using namespace Opie::Ui;
ControlsDialog::ControlsDialog(const QString &caption,QImage image,int *brightness,QWidget *parent)
: QDialog(parent,0,true)
{
setCaption(caption);
if ( parent ) {
@@ -283,13 +285,13 @@ ImageViewer::ImageViewer( QWidget *parent, const char *name, int /*wFlags*/ )
ImageFileSelector::CURRENT_VIEW cv;
if(showThumbView)
cv=ImageFileSelector::THUMBNAIL;
else
cv=ImageFileSelector::DETAILED;
- qDebug("cv = %d",cv);
+ odebug << "cv = " << cv << "" << oendl;
fileSelector = new ImageFileSelector( cv,stack, "fs");
//switchThumbView();
@@ -410,13 +412,13 @@ void ImageViewer::settings()
dlg.setRepeat( slideRepeat );
dlg.setReverse( slideReverse );
dlg.setRotate(rotateOnLoad);
dlg.setFastLoad(fastLoad);
if ( QPEApplication::execDialog(&dlg) == QDialog::Accepted ) {
- qDebug("<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>");
+ odebug << "<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>" << oendl;
slideDelay = dlg.delay();
slideRepeat = dlg.repeat();
slideReverse = dlg.reverse();
rotateOnLoad = dlg.rotate();
fastLoad = dlg.fastLoad();
@@ -502,13 +504,13 @@ void ImageViewer::show()
normalView();
QMainWindow::show();
}
void ImageViewer::show(const QString& fileref)
{
-// qDebug("Show "+fileref);
+// odebug << "Show "+fileref << oendl;
bFromDocView = TRUE;
closeFileSelector();
DocLnk link(fileref);
if ( link.isValid() ) {
openFile(link);
} else {
@@ -532,13 +534,13 @@ void ImageViewer::openFile() {
}
void ImageViewer::openFile( const DocLnk &link )
{
closeFileSelector();
// DocLnk link(file);
- qDebug("open "+link.name());
+ odebug << "open "+link.name() << oendl;
updateCaption( link.name() );
loadImage( link.file() );
if (slideTimer->isActive()) {
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,7 +1,7 @@
-CONFIG += qt warn_on quick-app
+CONFIG += qt warn_on quick-app
HEADERS = showimg.h ImageFileSelector.h settingsdialog.h settingsdialogbase.h
SOURCES = main.cpp showimg.cpp ImageFileSelector.cpp settingsdialog.cpp settingsdialogbase.cpp
TARGET = showimg
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe -lopiecore2 -lopieui2
diff --git a/noncore/multimedia/tonleiter/config.in b/noncore/multimedia/tonleiter/config.in
index d580ad7..9bd167e 100644
--- a/noncore/multimedia/tonleiter/config.in
+++ b/noncore/multimedia/tonleiter/config.in
@@ -1,4 +1,4 @@
config TONLEITER
boolean "tonleiter (shows scales on sting instruments)"
default "n"
- depends ( LIBQPE || LIBQPE-X11 )
+ depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE
diff --git a/noncore/multimedia/tonleiter/editinst.cpp b/noncore/multimedia/tonleiter/editinst.cpp
index ccb4560..a8c20c8 100644
--- a/noncore/multimedia/tonleiter/editinst.cpp
+++ b/noncore/multimedia/tonleiter/editinst.cpp
@@ -1,11 +1,16 @@
#include "editinst.h"
-#include <qpushbutton.h>
-
+/* OPIE */
+#include <opie2/odebug.h>
+#include <qpe/config.h>
#include <qpe/qpeapplication.h>
+using namespace Opie::Core;
+
+/* QT */
+#include <qpushbutton.h>
Menu::InstEditDialog::InstEditDialog(TonleiterData* data,QWidget* parent,const char* name)
:QDialog(parent,name,true,0),data(data)
{
setCaption("Tonleiter::"+tr("Instrument"));
QBoxLayout* masterlayout=new QBoxLayout(this,QBoxLayout::TopToBottom);
@@ -97,13 +102,13 @@ void Menu::InstEditDialog::saveInstrument()
}
//****************************************************************************
void Menu::InstEditDialog::loadInstrument()
{
stringlist.clear();
Instrument inst=data->getInstrument(instid);
- qDebug("load Instrument : %d strings",inst.noOfStrings());
+ odebug << "load Instrument : " << inst.noOfStrings() << " strings" << oendl;
for(uint s=0;s<inst.noOfStrings();s++)
{
stringlist.append(new EditStringWidget(inst.string(s),stringwidget));
}
}
//****************************************************************************
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,8 +1,13 @@
#include "fretboard.h"
+/* OPIE */
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+
+/* QT */
#include <qpainter.h>
Graph::FretBoard::FretBoard(TonleiterData* data,QWidget* parent,const char* name,WFlags f)
:QWidget(parent,name,f),data(data)
{
setBackgroundColor(QColor(0,0,0));
@@ -24,13 +29,13 @@ void Graph::FretBoard::dataChange()
void Graph::FretBoard::paintEvent(QPaintEvent* pe)
{
Q_UNUSED(pe);
int instid=data->getCurrentInstrumentID();
inst=data->getInstrument(instid);
- //qDebug("inst %d is %s",instid,inst.instName().data());
+ //odebug << "inst " << instid << " is " << inst.instName().data() << "" << oendl;
QRect mysize=rect();
xmargin=(int)(mysize.width()*0.05);
xmin=2*xmargin;
xmax=mysize.width()-xmargin;
@@ -140,23 +145,23 @@ void Graph::FretBoard::paintScale(QPainter* p)
{
int x=(int)(fretdist*f)+xmin;
//no more than six octaves can be visualised (there is a zero octave)
int octave=Note::octaveOfBaseNote(data->getCurrentBaseNote(),note)-baseoctave;
if(octave<0)
- qDebug("%d,%d",octave,baseoctave);
+ odebug << "" << octave << "," << baseoctave << "" << oendl;
if(octave>5)
{
- qDebug("octave out of range");
+ odebug << "octave out of range" << oendl;
octave=5;
}
p->setPen(QColor(255,0,0));
int c= ( (note-12*baseoctave) - (12*octave+data->getCurrentBaseNote()) )*15;
if(c<0 || c>255)
- qDebug("%d = %d - ( %d + %d)",c,note,12*octave,data->getCurrentBaseNote());
+ odebug << "" << c << " = " << note << " - ( " << 12*octave << " + " << data->getCurrentBaseNote() << ")" << oendl;
QColor dotcolor(255,255,255);
if(octave==0)
dotcolor=QColor(c,c,255);
else if(octave==1)
dotcolor=QColor(c,255,c);
diff --git a/noncore/multimedia/tonleiter/tonleiter.pro b/noncore/multimedia/tonleiter/tonleiter.pro
index 4bd1bc2..4be3bef 100644
--- a/noncore/multimedia/tonleiter/tonleiter.pro
+++ b/noncore/multimedia/tonleiter/tonleiter.pro
@@ -1,13 +1,11 @@
TEMPLATE = app
-#CONFIG = qt warn_on
CONFIG = qt warn_on
HEADERS = mainwidget.h tonleiterdata.h tonleiterdatahelper.h fretboard.h menuwidget.h editinst.h editstringwidget.h editscale.h pianoscale.h
SOURCES = mainwidget.cpp tonleiterdata.cpp tonleiterdatahelper.cpp fretboard.cpp menuwidget.cpp main.cpp editinst.cpp editstringwidget.cpp editscale.cpp pianoscale.cpp
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
-LIBS += -lqpe
-INTERFACES =
+LIBS += -lqpe -lopiecore2
TARGET = tonleiter
DESTDIR = $(OPIEDIR)/bin
-#TMAKE_CXXFLAGS += -DQT_QWS_VERCEL_IDR -DQWS -fno-exceptions -fno-rtti
+
include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/multimedia/tonleiter/tonleiterdata.cpp b/noncore/multimedia/tonleiter/tonleiterdata.cpp
index 33b3c49..564b7f0 100644
--- a/noncore/multimedia/tonleiter/tonleiterdata.cpp
+++ b/noncore/multimedia/tonleiter/tonleiterdata.cpp
@@ -1,12 +1,13 @@
#include "tonleiterdata.h"
-
-#include <qpe/config.h>
-
using namespace Data;
+/* OPIE */
+#include <opie2/odebug.h>
+#include <qpe/config.h>
+using namespace Opie::Core;
TonleiterData::TonleiterData(QObject* parent)
:QObject(parent)
{
drawnames=true;
loadData();
@@ -149,13 +150,13 @@ int TonleiterData::noOfInstruments()
Instrument TonleiterData::getInstrument(int id)
{
if(id>=0 && id<noOfInstruments())
return instruments[id];
else
{
- qDebug("undefined insrtument %d of %d",id,instruments.count());
+ odebug << "undefined insrtument " << id << " of " << instruments.count() << "" << oendl;
return Instrument();
}
}
//****************************************************************************
int TonleiterData::getCurrentInstrumentID()
@@ -171,13 +172,13 @@ int TonleiterData::noOfScales()
Scale TonleiterData::getScale(int id)
{
if(id>=0 && id<noOfScales())
return scales[id];
else
{
- qDebug("Undefined scale");
+ odebug << "Undefined scale" << oendl;
return Scale();
}
}
//****************************************************************************
int TonleiterData::getCurrentScaleID()
{
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
@@ -31,13 +31,13 @@ int Note::getNoteFromName(QString name,int octave)
}
//****************************************************************************
int Note::octaveOfBaseNote(int base,int note)
{
int normnote = (note>=base) ? note-base : (12-base)+note;
int octave=getOctaveOfNote(normnote);
- //qDebug("note %d of %d base is norm %d -> ocatve %d",note,base,normnote,octave);
+ //odebug << "note " << note << " of " << base << " base is norm " << normnote << " -> ocatve " << octave << "" << oendl;
return octave;
}
//****************************************************************************
//****************************************************************************
Instrument::Instrument()
{
@@ -128,17 +128,17 @@ bool Scale::noteInScale(int base,int note)
int octave=Note::getOctaveOfNote(note);
note-=12*octave;
int normnote = (note>=base) ? note-base : (12-base)+note;
if(halftones.contains(normnote)>0)
{
- //qDebug("OK : base : %d, note %d -> norm %d",base,note,normnote);
+ //odebug << "OK : base : " << base << ", note " << note << " -> norm " << normnote << "" << oendl;
return true;
}
else
{
- //qDebug("BAD : base : %d, note %d -> norm %d",base,note,normnote);
+ //odebug << "BAD : base : " << base << ", note " << note << " -> norm " << normnote << "" << oendl;
return false;
}
}
//****************************************************************************
//****************************************************************************