⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mediarecorderbase.cpp

📁 改写的qtopia录音放音程序
💻 CPP
字号:
/****************************************************************************** Form implementation generated from reading ui file 'mediarecorderbase.ui'**** Created: Sun Oct 9 17:41:58 2005**      by:  The User Interface Compiler (uic)**** WARNING! All changes made in this file will be lost!****************************************************************************/#include "mediarecorderbase.h"#include <qcombobox.h>#include <qgroupbox.h>#include <qlabel.h>#include <qpushbutton.h>#include <qtopia/locationcombo.h>#include "timeprogressbar.h"#include "waveform.h"#include <qlayout.h>#include <qvariant.h>#include <qtooltip.h>#include <qwhatsthis.h>/*  *  Constructs a MediaRecorderBase which is a child of 'parent', with the  *  name 'name' and widget flags set to 'f'  */MediaRecorderBase::MediaRecorderBase( QWidget* parent,  const char* name, WFlags fl )    : QWidget( parent, name, fl ){    if ( !name )	setName( "MediaRecorderBase" );    resize( 276, 210 );     setCaption( tr( "Voice Recorder" ) );    MediaRecorderBaseLayout = new QGridLayout( this );     MediaRecorderBaseLayout->setSpacing( 4 );    MediaRecorderBaseLayout->setMargin( 4 );    progress = new TimeProgressBar( this, "progress" );    progress->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, progress->sizePolicy().hasHeightForWidth() ) );    progress->setMinimumSize( QSize( 0, 30 ) );    MediaRecorderBaseLayout->addMultiCellWidget( progress, 2, 2, 0, 1 );    Layout5 = new QHBoxLayout;     Layout5->setSpacing( 2 );    Layout5->setMargin( 0 );    recordButton = new QPushButton( this, "recordButton" );    recordButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, recordButton->sizePolicy().hasHeightForWidth() ) );    recordButton->setFocusPolicy( QPushButton::StrongFocus );    recordButton->setText( tr( "Record" ) );    Layout5->addWidget( recordButton );        choosefileButton = new QPushButton( this, "choosefileButton" );    choosefileButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, choosefileButton->sizePolicy().hasHeightForWidth() ) );    choosefileButton->setFocusPolicy( QPushButton::StrongFocus );    choosefileButton->setText( tr( "Choosefile" ) );    Layout5->addWidget( choosefileButton );    replayButton = new QPushButton( this, "replayButton" );    replayButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, replayButton->sizePolicy().hasHeightForWidth() ) );    replayButton->setFocusPolicy( QPushButton::StrongFocus );    replayButton->setText( tr( "Play" ) );    Layout5->addWidget( replayButton );    deleteButton = new QPushButton( this, "deleteButton" );    deleteButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, deleteButton->sizePolicy().hasHeightForWidth() ) );    deleteButton->setFocusPolicy( QPushButton::StrongFocus );    deleteButton->setText( tr( "Delete" ) );    Layout5->addWidget( deleteButton );    MediaRecorderBaseLayout->addMultiCellLayout( Layout5, 4, 4, 0, 1);    waveform = new Waveform( this, "waveform" );    waveform->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)3, waveform->sizePolicy().hasHeightForWidth() ) );    waveform->setMinimumSize( QSize( 0, 30 ) );    MediaRecorderBaseLayout->addMultiCellWidget( waveform, 1, 1, 0, 1 );    GroupBox2 = new QGroupBox( this, "GroupBox2" );    GroupBox2->setTitle( tr( "Storage Location" ) );    GroupBox2->setColumnLayout(0, Qt::Vertical );    GroupBox2->layout()->setSpacing( 0 );    GroupBox2->layout()->setMargin( 0 );    GroupBox2Layout = new QGridLayout( GroupBox2->layout() );    GroupBox2Layout->setAlignment( Qt::AlignTop );    GroupBox2Layout->setSpacing( 6 );    GroupBox2Layout->setMargin( 11 );    storageLocation = new LocationCombo( GroupBox2, "storageLocation" );    storageLocation->setFocusPolicy( LocationCombo::TabFocus );    GroupBox2Layout->addWidget( storageLocation, 0, 0 );    Layout6 = new QHBoxLayout;     Layout6->setSpacing( 6 );    Layout6->setMargin( 0 );    TextLabel2 = new QLabel( GroupBox2, "TextLabel2" );    TextLabel2->setText( tr( "Max Time:" ) );    Layout6->addWidget( TextLabel2 );    maxTime = new QLabel( GroupBox2, "maxTime" );    maxTime->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, maxTime->sizePolicy().hasHeightForWidth() ) );    maxTime->setTextFormat( QLabel::RichText );    maxTime->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignLeft ) );    Layout6->addWidget( maxTime );    GroupBox2Layout->addLayout( Layout6, 1, 0 );    MediaRecorderBaseLayout->addWidget( GroupBox2, 0, 1 );    GroupBox1 = new QGroupBox( this, "GroupBox1" );    GroupBox1->setTitle( tr( "Quality" ) );    GroupBox1->setColumnLayout(0, Qt::Vertical );    GroupBox1->layout()->setSpacing( 0 );    GroupBox1->layout()->setMargin( 0 );    GroupBox1Layout = new QGridLayout( GroupBox1->layout() );    GroupBox1Layout->setAlignment( Qt::AlignTop );    GroupBox1Layout->setSpacing( 6 );    GroupBox1Layout->setMargin( 11 );    qualityCombo = new QComboBox( FALSE, GroupBox1, "qualityCombo" );    qualityCombo->insertItem( tr( "Voice" ) );    qualityCombo->insertItem( tr( "Music" ) );    qualityCombo->insertItem( tr( "CD" ) );    qualityCombo->insertItem( tr( "Custom" ) );    GroupBox1Layout->addWidget( qualityCombo, 0, 0 );    details = new QLabel( GroupBox1, "details" );    details->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, details->sizePolicy().hasHeightForWidth() ) );    details->setTextFormat( QLabel::RichText );    details->setAlignment( int( QLabel::AlignCenter ) );    GroupBox1Layout->addWidget( details, 1, 0 );    MediaRecorderBaseLayout->addWidget( GroupBox1, 0, 0 );    // tab order    setTabOrder( storageLocation, recordButton );    setTabOrder( recordButton, replayButton );}/*   *  Destroys the object and frees any allocated resources */MediaRecorderBase::~MediaRecorderBase(){    // no need to delete child widgets, Qt does it all for us}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -