www.pudn.com > wav_mp3_recorder.rar > mediarecorderbase.cpp
/**************************************************************************** ** Form implementation generated from reading ui file 'mediarecorderbase.ui' ** ** Created: Sat Aug 4 20:30:23 2007 ** by: The User Interface Compiler (uic) ** ** WARNING! All changes made in this file will be lost! ****************************************************************************/ #include "mediarecorderbase.h" #include#include #include #include #include "timeprogressbar.h" #include "waveform.h" #include #include #include #include #include #include /* * 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 --Whut" ) ); MediaRecorderBaseLayout = new QGridLayout( this ); MediaRecorderBaseLayout->setSpacing( 2 ); MediaRecorderBaseLayout->setMargin( 2 ); QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Minimum ); //Expanding MediaRecorderBaseLayout->addItem( spacer, 4, 0 ); 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( 10 ); 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 ); replayButton = new QPushButton( this, "replayButton" ); replayButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, replayButton->sizePolicy().hasHeightForWidth() ) ); replayButton->setFocusPolicy( QPushButton::StrongFocus ); replayButton->setText( tr( "Replay" ) ); Layout5->addWidget( replayButton ); MediaRecorderBaseLayout->addMultiCellLayout( Layout5, 3, 3, 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); // Layout4 Group = new QButtonGroup( this, "Wave---MP3" ); Group->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, Group->sizePolicy().hasHeightForWidth() ) ); Group->setAlignment(AlignHCenter); Group->setTitle( tr( "Enjoy -_- Recorde" ) ); Group->setColumnLayout(0, Qt::Horizontal ); Group->layout()->setSpacing( 6 ); Group->layout()->setMargin( 4 ); GroupLayout = new QHBoxLayout( Group->layout() ); GroupLayout->setAlignment( Qt::AlignCenter ); GroupLayout->setSpacing( 4 ); GroupLayout->setMargin( 4 ); Mp3Button = new QRadioButton( Group, "mp3button" ); Mp3Button->setText( tr( "Mp3" ) ); Mp3Button->setChecked(TRUE); GroupLayout->addWidget( Mp3Button ); QSpacerItem* spacer1 = new QSpacerItem( 100, 20, QSizePolicy::Minimum, QSizePolicy::Minimum ); //Expanding GroupLayout->addItem( spacer1 ); WaveButton = new QRadioButton( Group, "wavebutton" ); WaveButton->setText( tr( "Wave" ) ); GroupLayout->addWidget( WaveButton ); MediaRecorderBaseLayout->addMultiCellWidget(Group, 0, 0, 0, 1); setTabOrder( Mp3Button, WaveButton ); setTabOrder( WaveButton, recordButton ); setTabOrder( recordButton, replayButton ); setTabOrder( replayButton, Mp3Button ); } /* * Destroys the object and frees any allocated resources */ MediaRecorderBase::~MediaRecorderBase() { // no need to delete child widgets, Qt does it all for us }