summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opierec/qtrec.cpp
Side-by-side diff
Diffstat (limited to 'noncore/multimedia/opierec/qtrec.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opierec/qtrec.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/noncore/multimedia/opierec/qtrec.cpp b/noncore/multimedia/opierec/qtrec.cpp
index 0307d99..147f63d 100644
--- a/noncore/multimedia/opierec/qtrec.cpp
+++ b/noncore/multimedia/opierec/qtrec.cpp
@@ -428,102 +428,102 @@ void QtRec::init() {
QGridLayout *layout = new QGridLayout( this );
layout->setSpacing( 2);
layout->setMargin( 2);
TabWidget = new QTabWidget( this, "TabWidget" );
layout->addMultiCellWidget(TabWidget, 0, 7, 0, 7);
// TabWidget->setTabShape(QTabWidget::Triangular);
///**********<<<<<<<<<<<<>>>>>>>>>>>>***************
tab = new QWidget( TabWidget, "tab" );
QGridLayout *layout1 = new QGridLayout( tab);
layout1->setSpacing( 2);
layout1->setMargin( 2);
timeSlider = new QSlider( 0,100,10,0, QSlider::Horizontal, tab, (const char *) "timeSlider" );
// timeSlider->setFixedWidth(150);
layout1->addMultiCellWidget( timeSlider, 1, 1, 0, 3);
// timeSlider->setTickmarks(QSlider::Above);
timeLabel = new QLabel( tab, "TimeLabel" );
layout1->addMultiCellWidget( timeLabel, 0, 0, 0, 3);
playLabel2 = new QLabel(tab, "PlayLabel2" );
- playLabel2->setText("Play");
+ playLabel2->setText(tr("Play") );
playLabel2->setFixedHeight(18);
layout1->addMultiCellWidget( playLabel2, 0, 0, 4, 4);
Stop_PushButton = new QPushButton( tab, "Stop_PushButton" );
layout1->addMultiCellWidget( Stop_PushButton, 1, 1, 4, 4);
Stop_PushButton->setFixedSize(22,22);
Stop_PushButton->setPixmap( image4 );
toBeginningButton = new QPushButton( tab, "Beginning_PushButton" );
layout1->addMultiCellWidget(toBeginningButton, 1, 1, 5, 5);
toBeginningButton->setFixedSize(22,22);
toBeginningButton->setPixmap( Resource::loadPixmap("fastback") );
toEndButton = new QPushButton( tab, "End_PushButton" );
layout1->addMultiCellWidget( toEndButton, 1, 1, 6, 6);
toEndButton->setFixedSize(22,22);
toEndButton->setPixmap( Resource::loadPixmap( "fastforward" ) );
QLabel *recLabel2;
recLabel2 = new QLabel( tab, "recLabel2" );
- recLabel2->setText("Rec");
+ recLabel2->setText(tr("Rec"));
recLabel2->setFixedHeight(18);
layout1->addMultiCellWidget( recLabel2, 0, 0, 7, 7);
Rec_PushButton = new QPushButton( tab, "Rec_PushButton" );
layout1->addMultiCellWidget( Rec_PushButton, 1, 1, 7, 7);
Rec_PushButton->setFixedSize(22,22);
Rec_PushButton->setPixmap( image6 );
t = new QTimer( this );
connect( t, SIGNAL( timeout() ), SLOT( timerBreak() ) );
rewindTimer = new QTimer( this );
connect( rewindTimer, SIGNAL( timeout() ), SLOT( rewindTimerTimeout() ) );
forwardTimer = new QTimer( this );
connect( forwardTimer, SIGNAL( timeout() ), SLOT( forwardTimerTimeout() ) );
deleteSoundButton = new QPushButton( tab, "deleteSoundButton" );
layout1->addMultiCellWidget( deleteSoundButton, 1, 1, 8, 8);
deleteSoundButton->setText( tr( "Delete" ) );
ListView1 = new QListView( tab, "IconView1" );
layout1->addMultiCellWidget( ListView1, 2, 2, 0, 8);
ListView1->addColumn( tr( "Name" ) );
ListView1->setColumnWidth(0,140);
ListView1->setSorting( 1, false);
ListView1->addColumn( tr( "Time" ) ); //in seconds
ListView1->setColumnWidth(1,50);
- ListView1->addColumn( "Location");
+ ListView1->addColumn( tr("Location") );
ListView1->setColumnWidth(2,50);
- ListView1->addColumn( "Date");
+ ListView1->addColumn( tr("Date") );
ListView1->setColumnWidth(3,63);
ListView1->setColumnWidthMode(0,QListView::Manual);
ListView1->setColumnAlignment(1,QListView::AlignCenter);
ListView1->setColumnAlignment(2,QListView::AlignRight);
ListView1->setColumnAlignment(3,QListView::AlignLeft);
ListView1->setAllColumnsShowFocus( true );
QPEApplication::setStylusOperation( ListView1->viewport(),QPEApplication::RightOnHold);
TabWidget->insertTab( tab, tr( "Files" ) );
///**********<<<<<<<<<<<<>>>>>>>>>>>>***************
tab_3 = new QWidget( TabWidget, "tab_3" );
////////////////////////////////////
Layout19 = new QHBoxLayout( tab_3);
Layout19->setSpacing( 2 );
Layout19->setMargin( 0 );
Layout18 = new QVBoxLayout(this);
Layout18->setSpacing( 2 );
Layout18->setMargin( 0 );
Layout17 = new QHBoxLayout(this);
@@ -573,149 +573,149 @@ void QtRec::init() {
Layout16 = new QHBoxLayout(this);
Layout16->setSpacing( 2 );
Layout16->setMargin( 0 );
dirGroup = new QGroupBox( tab_3, "dirGroup" );
dirGroup->setTitle( tr( "File Directory" ) );
dirGroup->setFixedSize(130,50);
directoryComboBox = new QComboBox( false, dirGroup, "dirGroup" );
directoryComboBox->setGeometry( QRect( 10, 15, 115, 25 ) );
Layout18->addWidget( dirGroup );
bitGroup = new QGroupBox( tab_3, "bitGroup" );
bitGroup->setTitle( tr( "Bit Depth" ) );
bitGroup->setFixedSize(65,50);
bitRateComboBox = new QComboBox( false, bitGroup, "BitRateComboBox" );
bitRateComboBox->insertItem( tr( "16" ) );
bitRateComboBox->insertItem( tr( "8" ) );
bitRateComboBox->setGeometry( QRect( 5, 20, 50, 25 ) );
Layout18->addWidget( bitGroup );
- compressionCheckBox = new QCheckBox ( "Wave Compression (smaller files)", tab_3 );
+ compressionCheckBox = new QCheckBox ( tr("Wave Compression (smaller files)"), tab_3 );
Layout18->addWidget( compressionCheckBox );
- autoMuteCheckBox= new QCheckBox ( "auto Mute", tab_3 );
+ autoMuteCheckBox= new QCheckBox ( tr("auto Mute"), tab_3 );
Layout18->addWidget( autoMuteCheckBox );
Layout19->addLayout( Layout18 );
QWidget *d = QApplication::desktop();
int width=d->width();
int height=d->height();
if( width < height) {
tab_5 = new QWidget( TabWidget, "tab_5" );
QHBoxLayout *Layout19a;
Layout19a = new QHBoxLayout( tab_5);
Layout19a->setSpacing( 2 );
Layout19a->setMargin( 0 );
Layout15 = new QVBoxLayout(this);
Layout15->setSpacing( 2 );
Layout15->setMargin( 0 );
Layout15b = new QVBoxLayout(this);
Layout15b->setSpacing( 2 );
Layout15b->setMargin( 0 );
TextLabel2 = new QLabel( tab_5, "InputLabel" );
TextLabel2->setText( tr( "In"));
TextLabel2->setFixedWidth(35);
Layout15->addWidget( TextLabel2 );
TextLabel3 = new QLabel( tab_5, "OutputLabel" );
TextLabel3->setText( tr( "Out" ) );
Layout15b->addWidget( TextLabel3 );
InputSlider = new QSlider( -100, 0, 10, 0, QSlider::Vertical, tab_5, (const char *) "InputSlider" );
InputSlider->setTickmarks(QSlider::Both);
Layout15->addWidget( InputSlider);
OutputSlider = new QSlider( -100,0,10,0, QSlider::Vertical,tab_5,(const char *) "OutputSlider" );
OutputSlider->setTickmarks(QSlider::Both);
Layout15b->addWidget( OutputSlider );
- outMuteCheckBox = new QCheckBox ( "mute", tab_5 );
+ outMuteCheckBox = new QCheckBox ( tr("mute"), tab_5 );
Layout15->addWidget( outMuteCheckBox );
- inMuteCheckBox = new QCheckBox ( "mute", tab_5 );
+ inMuteCheckBox = new QCheckBox ( tr("mute"), tab_5 );
inMuteCheckBox-> setFocusPolicy ( QWidget::NoFocus );
Layout15b->addWidget( inMuteCheckBox );
Layout19a->addLayout( Layout15 );
Layout19a->addLayout( Layout15b );
fillDirectoryCombo();
TabWidget->insertTab( tab_3, tr( "Options" ) );
TabWidget->insertTab( tab_5, tr( "Volume" ) );
} else {// landscape
// Layout16->addWidget( dirGroup );
// Layout18->addLayout( Layout16 );
Layout15 = new QVBoxLayout(this);
Layout15->setSpacing( 2 );
Layout15->setMargin( 0 );
Layout15b = new QVBoxLayout(this);
Layout15b->setSpacing( 2 );
Layout15b->setMargin( 0 );
TextLabel2 = new QLabel( tab_3, "InputLabel" );
TextLabel2->setText( tr( "In"));
TextLabel2->setFixedWidth(35);
Layout15->addWidget( TextLabel2 );
TextLabel3 = new QLabel( tab_3, "OutputLabel" );
TextLabel3->setText( tr( "Out" ) );
Layout15b->addWidget( TextLabel3 );
InputSlider = new QSlider( -100, 0, 10, 0, QSlider::Vertical, tab_3, (const char *) "InputSlider" );
// InputSlider->setTickmarks(QSlider::Both);
Layout15->addWidget( InputSlider);
OutputSlider = new QSlider( -100,0,10,0, QSlider::Vertical,tab_3,(const char *) "OutputSlider" );
// OutputSlider->setTickmarks(QSlider::Both);
Layout15b->addWidget( OutputSlider );
- outMuteCheckBox = new QCheckBox ( "mute", tab_3 );
+ outMuteCheckBox = new QCheckBox ( tr("mute"), tab_3 );
Layout15->addWidget( outMuteCheckBox );
- inMuteCheckBox = new QCheckBox ( "mute", tab_3 );
+ inMuteCheckBox = new QCheckBox ( tr("mute"), tab_3 );
inMuteCheckBox-> setFocusPolicy ( QWidget::NoFocus );
Layout15b->addWidget( inMuteCheckBox );
Layout19->addLayout( Layout15 );
Layout19->addLayout( Layout15b );
fillDirectoryCombo();
TabWidget->insertTab( tab_3, tr( "Options" ) );
}
///**********<<<<<<<<<<<<>>>>>>>>>>>>***************
// tab_4 = new QWidget( TabWidget, "tab_4" );
// QGridLayout *layout4 = new QGridLayout( tab_4);
// layout4->setSpacing( 2);
// layout4->setMargin( 2);
// TabWidget->insertTab( tab_4, tr( "Help"));
// ///////////////////////////////////////////// FIXME change to a real helpfile path
// QString url="/index.html";
@@ -854,84 +854,84 @@ void QtRec::initConfig() {
cofg.setGroup( "Volume");
outMuteCheckBox->setChecked( cofg.readBoolEntry( "Mute",0));
inMuteCheckBox->setChecked( cofg.readBoolEntry( "MicMute",0));
}
//================
void QtRec::stop() {
qDebug("<<<<<<<<<stop()");
setRecordButton(false);
monitoring=false;
stopped=true;
if( !recording)
endPlaying();
else
endRecording();
timeSlider->setValue(0);
// QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << true; // mute device
}
void QtRec::doPlayBtn() {
if(!stopped) {
- playLabel2->setText("Play");
+ playLabel2->setText(tr("Play"));
stop();
} else {
if(ListView1->currentItem() == 0) return;
- playLabel2->setText("Stop");
+ playLabel2->setText(tr("Stop"));
currentFile = ListView1->currentItem()->text(0);
start();
}
}
void QtRec::start() { //play
if(stopped) {
qDebug("start::");
QPixmap image3( ( const char** ) image3_data );
Stop_PushButton->setPixmap( image3 );
Stop_PushButton->setDown(true);
stopped=false;
paused=false;
secCount=1;
if( openPlayFile())
if( setupAudio( false)) //recording is false
doPlay();
}
}
bool QtRec::rec() { //record
qDebug("rec()");
if(!stopped) {
qDebug("rec:: !stopped");
monitoring=true;
return false;
} else {
qDebug("go ahead and record");
secCount=1;
- playLabel2->setText("Stop");
+ playLabel2->setText(tr("Stop"));
monitoring=false;
setRecordButton(true);
stopped=false;
if( setupAudio( true))
if(setUpFile()) {
qDebug("Ok to start recording");
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());
//filePara.sampleRate = cfg.readNumEntry("samplerate", 22050);
qDebug("sample rate is %d", filePara.sampleRate);
filePara.SecondsToRecord = getCurrentSizeLimit();
qDebug("size limit %d sec", filePara.SecondsToRecord);
int diskSize = checkDiskSpace( (const QString &) wavFile->trackName());
if( filePara.SecondsToRecord == 0) {
fileSize = diskSize;
@@ -2138,57 +2138,57 @@ QString QtRec::getStorage(const QString &fileName) {
// qDebug(name);
}
return storage;
// struct mntent *me;
// // if(fileName == "/etc/mtab") {
// FILE *mntfp = setmntent( fileName.latin1(), "r" );
// if ( mntfp ) {
// while ( (me = getmntent( mntfp )) != 0 ) {
// QString filesystemType = me->mnt_type;
// }
// }
// endmntent( mntfp );
}
void QtRec::setRecordButton(bool b) {
if(b) { //about to record or play
Rec_PushButton->setDown(true);
QPixmap image3( ( const char** ) image3_data );
Stop_PushButton->setPixmap( image3 );
if(Stop_PushButton->isDown())
Stop_PushButton->setDown(true);
- playLabel2->setText("Stop");
+ playLabel2->setText(tr("Stop") );
} else { //about to stop
QPixmap image4( ( const char** ) image4_data );
Stop_PushButton->setPixmap( image4);
if(Stop_PushButton->isDown())
Stop_PushButton->setDown(false);
- playLabel2->setText("Play");
+ playLabel2->setText(tr("Play") );
if(Rec_PushButton->isDown())
Rec_PushButton->setDown( false);
}
}
void QtRec::fillDirectoryCombo() {
if( directoryComboBox->count() > 0)
directoryComboBox->clear();
int index=0;
Config cfg("OpieRec");
cfg.setGroup("Settings");
QString dir= cfg.readEntry("directory", "/");
StorageInfo storageInfo;
const QList<FileSystem> &fs = storageInfo.fileSystems();
QListIterator<FileSystem> it ( fs );
QString storage;
for( ; it.current(); ++it ){
const QString name = (*it)->name();
const QString path = (*it)->path();
// directoryComboBox->insertItem(name+" "+path);
directoryComboBox->insertItem(name);
if(path==dir)
directoryComboBox->setCurrentItem(index);
index++;