summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2003-05-26 03:13:01 (UTC)
committer llornkcor <llornkcor>2003-05-26 03:13:01 (UTC)
commit830bab619ea396c018ccd29b20ce81cb47e113e1 (patch) (unidiff)
tree41acd0f61f309992e5cd8faa4995cafff099fea1
parenteaa924af86511fd43fc9eac5438e73972f82158b (diff)
downloadopie-830bab619ea396c018ccd29b20ce81cb47e113e1.zip
opie-830bab619ea396c018ccd29b20ce81cb47e113e1.tar.gz
opie-830bab619ea396c018ccd29b20ce81cb47e113e1.tar.bz2
remove extra includes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opierec/device.cpp6
-rw-r--r--noncore/multimedia/opierec/helpwindow.cpp23
-rw-r--r--noncore/multimedia/opierec/opierec.control2
-rw-r--r--noncore/multimedia/opierec/qtrec.cpp16
-rw-r--r--noncore/multimedia/opierec/wavFile.cpp2
5 files changed, 1 insertions, 48 deletions
diff --git a/noncore/multimedia/opierec/device.cpp b/noncore/multimedia/opierec/device.cpp
index c2029b7..f9a80c5 100644
--- a/noncore/multimedia/opierec/device.cpp
+++ b/noncore/multimedia/opierec/device.cpp
@@ -1,62 +1,56 @@
1// device.cpp 1// device.cpp
2 2
3#include "device.h" 3#include "device.h"
4#include "qtrec.h"
5 4
6#include <qpe/qpeapplication.h>
7#include <qpe/config.h> 5#include <qpe/config.h>
8#include <qpe/qcopenvelope_qws.h> 6#include <qpe/qcopenvelope_qws.h>
9 7
10#include <qslider.h>
11#include <qmessagebox.h>
12 8
13#include <qfile.h>
14#include <qtextstream.h>
15#include <fcntl.h> 9#include <fcntl.h>
16#include <stdio.h> 10#include <stdio.h>
17#include <stdlib.h> 11#include <stdlib.h>
18#include <sys/ioctl.h> 12#include <sys/ioctl.h>
19#include <sys/soundcard.h> 13#include <sys/soundcard.h>
20#include <unistd.h> 14#include <unistd.h>
21#include<sys/wait.h> 15#include<sys/wait.h>
22// #include <sys/stat.h> 16// #include <sys/stat.h>
23// #include <sys/time.h> 17// #include <sys/time.h>
24// #include <sys/types.h> 18// #include <sys/types.h>
25#include <unistd.h> 19#include <unistd.h>
26#include <errno.h> 20#include <errno.h>
27 21
28//extern QtRec *qperec; 22//extern QtRec *qperec;
29 23
30Device::Device( QObject * parent, const char * dsp, const char * mixr, bool record ) 24Device::Device( QObject * parent, const char * dsp, const char * mixr, bool record )
31 : QObject( parent) 25 : QObject( parent)
32{ 26{
33 dspstr = (char *)dsp; 27 dspstr = (char *)dsp;
34 mixstr = (char *)mixr; 28 mixstr = (char *)mixr;
35 29
36 devForm=-1; 30 devForm=-1;
37 devCh=-1; 31 devCh=-1;
38 devRate=-1; 32 devRate=-1;
39 33
40 if( !record){ //playing 34 if( !record){ //playing
41 qDebug("setting up DSP for playing"); 35 qDebug("setting up DSP for playing");
42 flags = O_WRONLY; 36 flags = O_WRONLY;
43 } else { //recording 37 } else { //recording
44 qDebug("setting up DSP for recording"); 38 qDebug("setting up DSP for recording");
45 flags = O_RDWR; 39 flags = O_RDWR;
46// flags = O_RDONLY; 40// flags = O_RDONLY;
47 selectMicInput(); 41 selectMicInput();
48 } 42 }
49} 43}
50 44
51bool Device::openDsp() { 45bool Device::openDsp() {
52 if( openDevice( flags) == -1) { 46 if( openDevice( flags) == -1) {
53 perror("<<<<<<<<<<<<<<ioctl(\"Open device\")"); 47 perror("<<<<<<<<<<<<<<ioctl(\"Open device\")");
54 return false; 48 return false;
55 } 49 }
56 return true; 50 return true;
57} 51}
58 52
59int Device::getOutVolume( ) { 53int Device::getOutVolume( ) {
60 unsigned int volume; 54 unsigned int volume;
61 int mixerHandle = open( mixstr, O_RDWR ); 55 int mixerHandle = open( mixstr, O_RDWR );
62 if ( mixerHandle >= 0 ) { 56 if ( mixerHandle >= 0 ) {
diff --git a/noncore/multimedia/opierec/helpwindow.cpp b/noncore/multimedia/opierec/helpwindow.cpp
index 0c4ac78..1ab6510 100644
--- a/noncore/multimedia/opierec/helpwindow.cpp
+++ b/noncore/multimedia/opierec/helpwindow.cpp
@@ -1,89 +1,66 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. 4** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
5** 5**
6** This file is part of an example program for Qt. This example 6** This file is part of an example program for Qt. This example
7** program may be used, distributed and modified without limitation. 7** program may be used, distributed and modified without limitation.
8** 8**
9*****************************************************************************/ 9*****************************************************************************/
10 10
11#include "helpwindow.h" 11#include "helpwindow.h"
12#include <qstatusbar.h>
13#include <qstringlist.h>
14#include <qlayout.h> 12#include <qlayout.h>
15 13
16#include <qpe/qpemenubar.h>
17#include <qpe/qpetoolbar.h> 14#include <qpe/qpetoolbar.h>
18#include <qpe/resource.h> 15#include <qpe/resource.h>
19 16
20#include <qaction.h> 17#include <qaction.h>
21#include <qpixmap.h>
22#include <qpopupmenu.h>
23#include <qmenubar.h> 18#include <qmenubar.h>
24#include <qtoolbutton.h>
25#include <qiconset.h>
26#include <qfile.h>
27#include <qtextstream.h>
28#include <qstylesheet.h>
29#include <qmessagebox.h>
30#include <qfiledialog.h>
31#include <qapplication.h>
32#include <qcombobox.h>
33#include <qevent.h>
34#include <qlineedit.h>
35#include <qobjectlist.h>
36#include <qfileinfo.h>
37#include <qfile.h>
38#include <qdatastream.h>
39#include <qprinter.h>
40#include <qsimplerichtext.h>
41#include <qpaintdevicemetrics.h>
42 19
43#include <ctype.h> 20#include <ctype.h>
44 21
45HelpWindow::HelpWindow( const QString& home_, const QString& _path, QWidget* parent, const char *name ) 22HelpWindow::HelpWindow( const QString& home_, const QString& _path, QWidget* parent, const char *name )
46 : QMainWindow( parent, name, WDestructiveClose ), pathCombo( 0 ), selectedURL() 23 : QMainWindow( parent, name, WDestructiveClose ), pathCombo( 0 ), selectedURL()
47{ 24{
48 QGridLayout *layout = new QGridLayout( this ); 25 QGridLayout *layout = new QGridLayout( this );
49 layout->setSpacing( 2); 26 layout->setSpacing( 2);
50 layout->setMargin( 2); 27 layout->setMargin( 2);
51 qDebug(_path); 28 qDebug(_path);
52 browser = new QTextBrowser( this ); 29 browser = new QTextBrowser( this );
53 QStringList Strlist; 30 QStringList Strlist;
54 Strlist.append( home_); 31 Strlist.append( home_);
55 browser->mimeSourceFactory()->setFilePath( Strlist ); 32 browser->mimeSourceFactory()->setFilePath( Strlist );
56 browser->setFrameStyle( QFrame::Panel | QFrame::Sunken ); 33 browser->setFrameStyle( QFrame::Panel | QFrame::Sunken );
57 34
58 connect( browser, SIGNAL( textChanged() ), this, SLOT( textChanged() ) ); 35 connect( browser, SIGNAL( textChanged() ), this, SLOT( textChanged() ) );
59 36
60 if ( !home_.isEmpty() ) 37 if ( !home_.isEmpty() )
61 browser->setSource( home_ ); 38 browser->setSource( home_ );
62 QPEToolBar *toolbar = new QPEToolBar( this ); 39 QPEToolBar *toolbar = new QPEToolBar( this );
63 40
64 QAction *a = new QAction( tr( "Backward" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); 41 QAction *a = new QAction( tr( "Backward" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 );
65 connect( a, SIGNAL( activated() ), browser, SLOT( backward() ) ); 42 connect( a, SIGNAL( activated() ), browser, SLOT( backward() ) );
66 a->addTo( toolbar ); 43 a->addTo( toolbar );
67 44
68 a = new QAction( tr( "Forward" ), Resource::loadPixmap( "forward" ), QString::null, 0, this, 0 ); 45 a = new QAction( tr( "Forward" ), Resource::loadPixmap( "forward" ), QString::null, 0, this, 0 );
69 connect( a, SIGNAL( activated() ), browser, SLOT( forward() ) ); 46 connect( a, SIGNAL( activated() ), browser, SLOT( forward() ) );
70 a->addTo( toolbar ); 47 a->addTo( toolbar );
71 48
72 49
73 layout->addMultiCellWidget( toolbar, 0, 0, 0, 0); 50 layout->addMultiCellWidget( toolbar, 0, 0, 0, 0);
74 51
75 layout->addMultiCellWidget( browser, 1, 2, 0, 2); 52 layout->addMultiCellWidget( browser, 1, 2, 0, 2);
76 53
77 browser->setFocus(); 54 browser->setFocus();
78} 55}
79 56
80 57
81void HelpWindow::setBackwardAvailable( bool b) 58void HelpWindow::setBackwardAvailable( bool b)
82{ 59{
83 menuBar()->setItemEnabled( backwardId, b); 60 menuBar()->setItemEnabled( backwardId, b);
84} 61}
85 62
86void HelpWindow::setForwardAvailable( bool b) 63void HelpWindow::setForwardAvailable( bool b)
87{ 64{
88 menuBar()->setItemEnabled( forwardId, b); 65 menuBar()->setItemEnabled( forwardId, b);
89} 66}
diff --git a/noncore/multimedia/opierec/opierec.control b/noncore/multimedia/opierec/opierec.control
index e8396ae..455691f 100644
--- a/noncore/multimedia/opierec/opierec.control
+++ b/noncore/multimedia/opierec/opierec.control
@@ -1,10 +1,10 @@
1Package: opierec 1Package: opie-rec
2Files: bin/opierec pics/opierec apps/Applications/opierec.desktop 2Files: bin/opierec pics/opierec apps/Applications/opierec.desktop
3Priority: optional 3Priority: optional
4Section: multimedia/applications 4Section: multimedia/applications
5Maintainer: L.J. Potter <ljp@llornkcor.com> 5Maintainer: L.J. Potter <ljp@llornkcor.com>
6Architecture: arm 6Architecture: arm
7Version: 1.5-2 7Version: 1.5-2
8Depends: opie ($QPE_VERSION) 8Depends: opie ($QPE_VERSION)
9Description: audio sampling recorder 9Description: audio sampling recorder
10 A simple audio recording/playing application. 10 A simple audio recording/playing application.
diff --git a/noncore/multimedia/opierec/qtrec.cpp b/noncore/multimedia/opierec/qtrec.cpp
index 28f6546..0307d99 100644
--- a/noncore/multimedia/opierec/qtrec.cpp
+++ b/noncore/multimedia/opierec/qtrec.cpp
@@ -1,107 +1,91 @@
1/**************************************************************************** 1/****************************************************************************
2 // qtrec.cpp 2 // qtrec.cpp
3 Created: Thu Jan 17 11:19:58 2002 3 Created: Thu Jan 17 11:19:58 2002
4 copyright 2002 by L.J. Potter <ljp@llornkcor.com> 4 copyright 2002 by L.J. Potter <ljp@llornkcor.com>
5****************************************************************************/ 5****************************************************************************/
6 6
7#define DEV_VERSION 7#define DEV_VERSION
8 8
9#include "pixmaps.h" 9#include "pixmaps.h"
10#include "qtrec.h" 10#include "qtrec.h"
11#include "helpwindow.h"
12#include "device.h"
13#include "wavFile.h"
14 11
15#include <pthread.h> 12#include <pthread.h>
16 13
17extern "C" { 14extern "C" {
18#include "adpcm.h" 15#include "adpcm.h"
19} 16}
20 17
21#include <sys/soundcard.h> 18#include <sys/soundcard.h>
22 19
23// #if defined (QTOPIA_INTERNAL_FSLP) 20// #if defined (QTOPIA_INTERNAL_FSLP)
24// #include <qpe/lnkproperties.h> 21// #include <qpe/lnkproperties.h>
25// #endif 22// #endif
26 23
27#include <qpe/applnk.h>
28#include <qpe/config.h> 24#include <qpe/config.h>
29#include <qpe/ir.h>
30#include <qpe/qcopenvelope_qws.h> 25#include <qpe/qcopenvelope_qws.h>
31#include <qpe/qpeapplication.h> 26#include <qpe/qpeapplication.h>
32#include <qpe/resource.h> 27#include <qpe/resource.h>
33#include <qpe/storage.h> 28#include <qpe/storage.h>
34 29
35#include <qlineedit.h>
36#include <qbuttongroup.h>
37#include <qcheckbox.h> 30#include <qcheckbox.h>
38#include <qcombobox.h> 31#include <qcombobox.h>
39#include <qcursor.h>
40//#include <qdatetime.h> 32//#include <qdatetime.h>
41#include <qdir.h> 33#include <qdir.h>
42#include <qfile.h>
43#include <qtextstream.h>
44#include <qgroupbox.h> 34#include <qgroupbox.h>
45#include <qiconview.h>
46#include <qimage.h>
47#include <qlabel.h> 35#include <qlabel.h>
48#include <qlayout.h> 36#include <qlayout.h>
49#include <qlineedit.h>
50#include <qlistview.h> 37#include <qlistview.h>
51#include <qmessagebox.h> 38#include <qmessagebox.h>
52#include <qpixmap.h>
53#include <qpopupmenu.h> 39#include <qpopupmenu.h>
54#include <qpushbutton.h> 40#include <qpushbutton.h>
55#include <qregexp.h>
56#include <qslider.h> 41#include <qslider.h>
57#include <qtabwidget.h> 42#include <qtabwidget.h>
58#include <qtimer.h> 43#include <qtimer.h>
59#include <qvariant.h>
60 44
61#include <errno.h> 45#include <errno.h>
62#include <fcntl.h> 46#include <fcntl.h>
63#include <math.h> 47#include <math.h>
64#include <mntent.h> 48#include <mntent.h>
65#include <stdio.h> 49#include <stdio.h>
66#include <stdlib.h> 50#include <stdlib.h>
67#include <sys/ioctl.h> 51#include <sys/ioctl.h>
68#include <sys/soundcard.h> 52#include <sys/soundcard.h>
69#include <sys/stat.h> 53#include <sys/stat.h>
70#include <sys/time.h> 54#include <sys/time.h>
71#include <sys/types.h> 55#include <sys/types.h>
72#include <sys/vfs.h> 56#include <sys/vfs.h>
73#include <unistd.h> 57#include <unistd.h>
74#include<sys/wait.h> 58#include<sys/wait.h>
75#include <sys/signal.h> 59#include <sys/signal.h>
76 60
77//#define ZAURUS 0 61//#define ZAURUS 0
78struct adpcm_state encoder_state; 62struct adpcm_state encoder_state;
79struct adpcm_state decoder_state; 63struct adpcm_state decoder_state;
80 64
81long findPeak(long input ); 65long findPeak(long input );
82//char deviceRates[]; 66//char deviceRates[];
83 67
84typedef struct { 68typedef struct {
85 int sampleRate; 69 int sampleRate;
86 /* int fragSize; */ 70 /* int fragSize; */
87 /* int blockSize; */ 71 /* int blockSize; */
88 int resolution; //bitrate 72 int resolution; //bitrate
89 int channels; //number of channels 73 int channels; //number of channels
90 int fd; //file descriptor 74 int fd; //file descriptor
91 int sd; //sound device descriptor 75 int sd; //sound device descriptor
92 int numberSamples; //total number of samples 76 int numberSamples; //total number of samples
93 int SecondsToRecord; // number of seconds that should be recorded 77 int SecondsToRecord; // number of seconds that should be recorded
94 float numberOfRecordedSeconds; //total number of samples recorded 78 float numberOfRecordedSeconds; //total number of samples recorded
95 int samplesToRecord; //number of samples to be recorded 79 int samplesToRecord; //number of samples to be recorded
96 int inVol; //input volume 80 int inVol; //input volume
97 int outVol; //output volume 81 int outVol; //output volume
98 int format; //wavfile format PCM.. ADPCM 82 int format; //wavfile format PCM.. ADPCM
99 const char *fileName; //name of fiel to be played/recorded 83 const char *fileName; //name of fiel to be played/recorded
100} fileParameters; 84} fileParameters;
101 85
102fileParameters filePara; 86fileParameters filePara;
103 87
104bool monitoring, recording; 88bool monitoring, recording;
105bool stopped; 89bool stopped;
106QLabel *timeLabel; 90QLabel *timeLabel;
107QSlider *timeSlider; 91QSlider *timeSlider;
diff --git a/noncore/multimedia/opierec/wavFile.cpp b/noncore/multimedia/opierec/wavFile.cpp
index 0bb5736..7bfffb6 100644
--- a/noncore/multimedia/opierec/wavFile.cpp
+++ b/noncore/multimedia/opierec/wavFile.cpp
@@ -1,54 +1,52 @@
1//wavFile.cpp 1//wavFile.cpp
2#include "wavFile.h" 2#include "wavFile.h"
3#include "qtrec.h" 3#include "qtrec.h"
4 4
5#include <qdatetime.h>
6#include <qstring.h>
7#include <qmessagebox.h> 5#include <qmessagebox.h>
8#include <qdir.h> 6#include <qdir.h>
9 7
10#include <qpe/timestring.h> 8#include <qpe/timestring.h>
11#include <qpe/config.h> 9#include <qpe/config.h>
12 10
13#include <errno.h> 11#include <errno.h>
14 12
15#include <sys/time.h> 13#include <sys/time.h>
16#include <sys/types.h> 14#include <sys/types.h>
17#include <sys/vfs.h> 15#include <sys/vfs.h>
18 16
19#include <fcntl.h> 17#include <fcntl.h>
20#include <math.h> 18#include <math.h>
21#include <mntent.h> 19#include <mntent.h>
22#include <stdio.h> 20#include <stdio.h>
23#include <stdlib.h> 21#include <stdlib.h>
24#include <unistd.h> 22#include <unistd.h>
25 23
26WavFile::WavFile( QObject * parent,const QString &fileName, bool makeNwFile, int sampleRate, 24WavFile::WavFile( QObject * parent,const QString &fileName, bool makeNwFile, int sampleRate,
27 int channels, int resolution, int format ) 25 int channels, int resolution, int format )
28 : QObject( parent) 26 : QObject( parent)
29{ 27{
30qDebug("new wave file"); 28qDebug("new wave file");
31 bool b = makeNwFile; 29 bool b = makeNwFile;
32 wavSampleRate=sampleRate; 30 wavSampleRate=sampleRate;
33 wavFormat=format; 31 wavFormat=format;
34 wavChannels=channels; 32 wavChannels=channels;
35 wavResolution=resolution; 33 wavResolution=resolution;
36 useTmpFile=false; 34 useTmpFile=false;
37 if( b) { 35 if( b) {
38 newFile(); 36 newFile();
39 } else { 37 } else {
40 openFile(fileName); 38 openFile(fileName);
41 } 39 }
42} 40}
43 41
44bool WavFile::newFile() { 42bool WavFile::newFile() {
45 43
46 qDebug("Set up new file"); 44 qDebug("Set up new file");
47 Config cfg("OpieRec"); 45 Config cfg("OpieRec");
48 cfg.setGroup("Settings"); 46 cfg.setGroup("Settings");
49 47
50 currentFileName=cfg.readEntry("directory",QDir::homeDirPath()); 48 currentFileName=cfg.readEntry("directory",QDir::homeDirPath());
51 QString date; 49 QString date;
52 date = TimeString::dateString( QDateTime::currentDateTime(),false,true); 50 date = TimeString::dateString( QDateTime::currentDateTime(),false,true);
53 date.replace(QRegExp("'"),""); 51 date.replace(QRegExp("'"),"");
54 date.replace(QRegExp(" "),"_"); 52 date.replace(QRegExp(" "),"_");