summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/imageinfoui.cpp2
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.cpp2
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp2
-rw-r--r--noncore/multimedia/opierec/qtrec.cpp18
-rw-r--r--noncore/multimedia/opierec/wavFile.cpp14
5 files changed, 19 insertions, 19 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageinfoui.cpp b/noncore/graphics/opie-eye/gui/imageinfoui.cpp
index 27a67a6..e70d6a6 100644
--- a/noncore/graphics/opie-eye/gui/imageinfoui.cpp
+++ b/noncore/graphics/opie-eye/gui/imageinfoui.cpp
@@ -135,49 +135,49 @@ void imageinfo::slotChangeName(const QString&_path)
SlaveMaster::self()->imageInfo( currentFile );
QPixmap*m_pix = PPixmapCache::self()->cachedImage( _path, THUMBSIZE,THUMBSIZE );
if (!m_pix) {
PixmapLabel1->setPixmap(QPixmap( Resource::loadPixmap( "UnknownDocument" )));
SlaveMaster::self()->thumbNail(currentFile,THUMBSIZE,THUMBSIZE);
} else {
PixmapLabel1->setPixmap(*m_pix);
}
}
imageinfo::~imageinfo()
{
{
QCopEnvelope( "QPE/Application/opie-eye_slave", "refDown()" );
}
if (m_viewManager) {
delete m_viewManager;
}
}
void imageinfo::slot_fullInfo(const QString&_path, const QString&_t)
{
if (_path == currentFile) {
- qDebug(_t);
+ odebug << _t << oendl;
QString t = _t;
t.replace(QRegExp("\n"),"<br>");
TextView1->setText(t);
}
}
void imageinfo::slotThumbNail(const QString&_path, const QPixmap&_pix)
{
if (_path == currentFile) {
if (_pix.width()>0) {
PPixmapCache::self()->insertImage( _path, _pix, THUMBSIZE, THUMBSIZE );
PixmapLabel1->setPixmap( _pix );
PixmapLabel1->resize(QSize(_pix.width(),_pix.height()));
}
}
}
void imageinfo::setPath( const QString& str ) {
slotChangeName( str );
}
void imageinfo::setDestructiveClose() {
WFlags fl = getWFlags();
/* clear it just in case */
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp
index 274a22a..6fff5ab 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.cpp
+++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp
@@ -21,49 +21,49 @@
#include <qpe/resource.h>
#include <qpe/config.h>
#include <qpe/ir.h>
#include <qpe/applnk.h>
#include <qtoolbar.h>
#include <qtoolbutton.h>
#include <qlayout.h>
#include <qdialog.h>
#include <qmap.h>
#include <qtimer.h>
#include <qframe.h>
//OPIE_EXPORT_APP_V2( Opie::Core::OApplicationFactory<PMainWindow>,"Opie Eye" )
OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow>)
PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style)
: QMainWindow( wid, name, style ), m_info( 0 ), m_disp( 0 )
{
setCaption( QObject::tr("Opie Eye Caramba" ) );
m_cfg = new Opie::Core::OConfig("phunkview");
m_cfg->setGroup("Zecke_view" );
-// qDebug( "Process-wide OApplication object @ %0x", oApp );
+// odebug << "Process-wide OApplication object @ " << oApp << oendl;
/*
* Initialize ToolBar and IconView
* And Connect Them
*/
QToolBar *bar = new QToolBar( this );
bar->setHorizontalStretchable( true );
setToolBarsMovable( false );
m_stack = new Opie::Ui::OWidgetStack( this );
setCentralWidget( m_stack );
m_view = new PIconView( m_stack, m_cfg );
m_stack->addWidget( m_view, IconView );
m_stack->raiseWidget( IconView );
connect(m_view, SIGNAL(sig_display(const QString&)),
this, SLOT(slotDisplay(const QString&)));
connect(m_view, SIGNAL(sig_showInfo(const QString&)),
this, SLOT(slotShowInfo(const QString&)) );
m_stack->forceMode(Opie::Ui::OWidgetStack::NoForce);
upButton = new QToolButton( bar );
upButton->setIconSet( Resource::loadIconSet( "up" ) );
connect( upButton, SIGNAL(clicked()),
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 95a0f45..1c08b41 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -199,49 +199,49 @@ void AudioWidget::setSeekable( bool isSeekable ) {
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();
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() ) );
}
}
static QString timeAsString( long length ) {
int minutes = length / 60;
int seconds = length % 60;
return QString("%1:%2%3").arg( minutes ).arg( seconds / 10 ).arg( seconds % 10 );
}
void AudioWidget::updateSlider( long i, long max ) {
time.setText( timeAsString( i ) + " / " + timeAsString( max ) );
-// qDebug( timeAsString( i ) + " / " + timeAsString( max ) ) ;
+// odebug << timeAsString( i ) << " / " << timeAsString( max ) << oendl;
if ( max == 0 ) {
return;
}
// Will flicker too much if we don't do this
// Scale to something reasonable
int width = slider.width();
int val = int((double)i * width / max);
if ( !audioSliderBeingMoved ) {
if ( slider.value() != val ) {
slider.setValue( val );
}
if ( slider.maxValue() != width ) {
slider.setMaxValue( width );
}
}
}
void AudioWidget::skipFor() {
skipDirection = +1;
startTimer( 50 );
mediaPlayerState.setPosition( mediaPlayerState.position() + 2 );
}
diff --git a/noncore/multimedia/opierec/qtrec.cpp b/noncore/multimedia/opierec/qtrec.cpp
index 6eb6524..3b8cb0d 100644
--- a/noncore/multimedia/opierec/qtrec.cpp
+++ b/noncore/multimedia/opierec/qtrec.cpp
@@ -100,52 +100,51 @@ typedef struct {
int outVol; //output volume
int format; //wavfile format PCM.. ADPCM
const char *fileName; //name of fiel to be played/recorded
} fileParameters;
fileParameters filePara;
bool monitoring, recording, playing;
bool stopped;
QLabel *timeLabel;
QSlider *timeSlider;
int sd;
Waveform* waveform;
Device *soundDevice;
#ifdef THREADED
void quickRec()
#else
void QtRec::quickRec()
#endif
{
- qDebug("%d",
- filePara.numberSamples/filePara.sampleRate * filePara.channels);
- qDebug("samples %d, rate %d, channels %d",
- filePara.numberSamples, filePara.sampleRate, filePara.channels);
+ odebug << ( filePara.numberSamples/filePara.sampleRate * filePara.channels ) << oendl;
+ odebug << "samples " << filePara.numberSamples << ", rate " << filePara.sampleRate
+ << ", channels " << filePara.channels << oendl;
int total = 0; // Total number of bytes read in so far.
int bytesWritten, number;
bytesWritten = 0;
number = 0;
QString num;
int level = 0;
int threshold = 0;
// int bits = filePara.resolution;
// odebug << "bits " << bits << "" << oendl;
if( filePara.resolution == 16 ) { //AFMT_S16_LE)
// 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) {
// odebug << "start recording WAVE_FORMAT_DVI_ADPCM" << oendl;
// <<<<<<<<<<<<<<<<<<<<<<<<<<< WAVE_FORMAT_DVI_ADPCM >>>>>>>>>>>>>>>>>>>>>>
char abuf[ BUFSIZE/2 ];
short sbuf[ BUFSIZE ];
@@ -898,75 +897,74 @@ void QtRec::start() { //play
if( openPlayFile())
if( setupAudio( false)) //recording is false
doPlay();
}
}
bool QtRec::rec() { //record
QString timeString;
timeString.sprintf("%.0f", 0.0);
timeLabel->setText( timeString+ " seconds");
if(!stopped) {
monitoring = true;
return false;
} else {
secCount = 1;
playLabel2->setText(tr("Stop"));
monitoring = false;
setRecordButton( true);
if( setupAudio( true))
if(setUpFile()) {
int fileSize = 0;
Config cfg("OpieRec");
cfg.setGroup("Settings");
-// qDebug( "<<<<<<<Device bits %d, device rate %d, device channels %d",
-// soundDevice->getDeviceBits(),
-// soundDevice->getDeviceRate(),
-// soundDevice->getDeviceChannels());
+// odebug << "<<<<<<<Device bits " << soundDevice->getDeviceBits()
+// << ", device rate " << soundDevice->getDeviceRate()
+// << ", device channels " << soundDevice->getDeviceChannels() << oendl;
//filePara.sampleRate = cfg.readNumEntry("samplerate", 22050);
// odebug << "sample rate is " << filePara.sampleRate << "" << oendl;
filePara.SecondsToRecord = getCurrentSizeLimit();
// 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) {
// odebug << "WAVE_FORMAT_PCM" << oendl;
fileSize = (filePara.SecondsToRecord ) * filePara.channels
* filePara.sampleRate * ( filePara.resolution / 8) + 1000;
} else {
// 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);
+ odebug << "filesize should be " << filePara.samplesToRecord
+ << ", bits " << filePara.resolution << ", rate " << filePara.sampleRate;
if( paused) {
paused = false;
}
// else {
odebug << "Setting timeslider " << filePara.samplesToRecord << "" << oendl;
// if(fileSize != 0)
timeSlider->setRange(0, filePara.samplesToRecord);
// }
if( diskSize < fileSize/1024) {
QMessageBox::warning(this,
tr("Low Disk Space"),
tr("You are running low of\nrecording space\n"
"or a card isn't being recognized"));
stopped = true; //we need to be stopped
stop();
} else {
QString msg;
msg.sprintf("%d, %d, %d", filePara.sampleRate, filePara.channels, filePara.resolution);
#ifdef DEV_VERSION
setCaption( msg);
#endif
filePara.fileName=currentFile.latin1();
odebug << "Start recording thread" << oendl;
diff --git a/noncore/multimedia/opierec/wavFile.cpp b/noncore/multimedia/opierec/wavFile.cpp
index 7e9b50f..fc0130c 100644
--- a/noncore/multimedia/opierec/wavFile.cpp
+++ b/noncore/multimedia/opierec/wavFile.cpp
@@ -131,50 +131,51 @@ 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
// odebug << "set header WAVE_FORMAT_PCM" << oendl;
}
else {
(*hdr).fmtTag = WAVE_FORMAT_DVI_ADPCM; //intel 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
(*hdr).avgBytesPerSec = (wavSampleRate)*( wavChannels*(wavResolution/8)); // bytes per second
(*hdr).nBlockAlign = wavChannels*( wavResolution/8); //block align
(*hdr).bitsPerSample = wavResolution; //bits per sample 8, or 16
strncpy((*hdr).dataID, "data", 4);
write( fd,hdr, sizeof(*hdr));
- qDebug("writing header: bitrate%d, samplerate %d, channels %d",
- wavResolution, wavSampleRate, wavChannels);
+ odebug << "writing header: bitrate " << wavResolution
+ << ", samplerate " << wavSampleRate
+ << ", channels " << wavChannels << oendl;
return true;
}
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));
odebug << "adjusting header " << total << "" << oendl;
return true;
}
int WavFile::parseWavHeader(int fd) {
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) {
odebug << " Could not read from sound file.\n" << oendl;
return -1;
@@ -191,50 +192,49 @@ int WavFile::parseWavHeader(int fd) {
if (strncmp(string, "WAVE", 4)) {
odebug << "not a valid WAV file.\n" << oendl;
return -1;
}
found = 0;
while (!found) {
if (read(fd, string, 4) < 4) {
odebug << "Could not read from sound file.\n" << oendl;
return -1;
}
if (strncmp(string, "fmt ", 4)) {
if (read(fd, &longdata, 4) < 4) {
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) {
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");
+ odebug << "Wave file contains unknown format. Unable to continue.\n" << oendl;
return -1;
}
wavFormat = fmt;
// compressionFormat=fmt;
odebug << "compressionFormat is " << fmt << "" << oendl;
if (read(fd, &ch, 2) < 2) {
odebug << "Could not read format chunk.\n" << oendl;
return -1;
} else {
wavChannels = ch;
odebug << "File has " << ch << " channels" << oendl;
}
if (read(fd, &samplerrate, 4) < 4) {
odebug << "Could not read from format chunk.\n" << oendl;
return -1;
} else {
wavSampleRate = samplerrate;
// sampleRate = samplerrate;
odebug << "File has samplerate of " << (int) samplerrate << "" << oendl;
}
lseek(fd, 6, SEEK_CUR);
if (read(fd, &bitrate, 2) < 2) {
odebug << "Could not read format chunk.\n" << oendl;
return -1;
@@ -245,50 +245,52 @@ int WavFile::parseWavHeader(int fd) {
}
found++;
}
}
found = 0;
while (!found) {
if (read(fd, string, 4) < 4) {
odebug << "Could not read from sound file.\n" << oendl;
return -1;
}
if (strncmp(string, "data", 4)) {
if (read(fd, &longdata, 4)<4) {
odebug << "Could not read from sound file.\n" << oendl;
return -1;
}
lseek(fd, longdata, SEEK_CUR);
} else {
if (read(fd, &longdata, 4) < 4) {
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)) );
+ odebug << "file hase length of " << (int)longdata << "\n"
+ << "lasting "
+ << (int)(( longdata / wavSampleRate) / wavChannels) / ( wavChannels*( wavResolution/8))
+ << " seconds" << oendl;
// wavSeconds = (( longdata / wavSampleRate) / wavChannels) / ( wavChannels*( wavResolution/8));
return longdata;
}
}
}
lseek(fd, 0, SEEK_SET);
return 0;
}
QString WavFile::trackName() {
return track.name();
}
int WavFile::wavHandle(){
return track.handle();
}
int WavFile::getFormat() {
return wavFormat;
}