About dialog & export dialog improvements. (#3826)

* Improve appearance of about dialog, export dialog
* Cleanup code comments/formatting
This commit is contained in:
Hussam Eddin Alhomsi
2017-11-15 07:59:14 +03:00
committed by Tres Finocchiaro
parent 57de274fe8
commit 548baa50a0
4 changed files with 108 additions and 93 deletions

View File

@@ -41,15 +41,15 @@ const ProjectRenderer::FileEncodeDevice ProjectRenderer::fileEncodeDevices[] =
{
{ ProjectRenderer::WaveFile,
QT_TRANSLATE_NOOP( "ProjectRenderer", "WAV-File (*.wav)" ),
QT_TRANSLATE_NOOP( "ProjectRenderer", "WAV (*.wav)" ),
".wav", &AudioFileWave::getInst },
{ ProjectRenderer::FlacFile,
QT_TRANSLATE_NOOP("ProjectRenderer", "FLAC-File (*.flac)"),
QT_TRANSLATE_NOOP("ProjectRenderer", "FLAC (*.flac)"),
".flac",
&AudioFileFlac::getInst
},
{ ProjectRenderer::OggFile,
QT_TRANSLATE_NOOP( "ProjectRenderer", "Compressed OGG-File (*.ogg)" ),
QT_TRANSLATE_NOOP( "ProjectRenderer", "OGG (*.ogg)" ),
".ogg",
#ifdef LMMS_HAVE_OGGVORBIS
&AudioFileOgg::getInst
@@ -58,7 +58,7 @@ const ProjectRenderer::FileEncodeDevice ProjectRenderer::fileEncodeDevices[] =
#endif
},
{ ProjectRenderer::MP3File,
QT_TRANSLATE_NOOP( "ProjectRenderer", "Compressed MP3-File (*.mp3)" ),
QT_TRANSLATE_NOOP( "ProjectRenderer", "MP3 (*.mp3)" ),
".mp3",
#ifdef LMMS_HAVE_MP3LAME
&AudioFileMP3::getInst
@@ -66,8 +66,8 @@ const ProjectRenderer::FileEncodeDevice ProjectRenderer::fileEncodeDevices[] =
NULL
#endif
},
// ... insert your own file-encoder-infos here... may be one day the
// user can add own encoders inside the program...
// Insert your own file-encoder infos here.
// Maybe one day the user can add own encoders inside the program.
{ ProjectRenderer::NumFileFormats, NULL, NULL, NULL }
@@ -109,15 +109,15 @@ ProjectRenderer::ProjectRenderer( const Mixer::qualitySettings & qualitySettings
ProjectRenderer::~ProjectRenderer()
{
Engine::mixer()->restoreAudioDevice(); // also deletes audio-dev
Engine::mixer()->restoreAudioDevice(); // Also deletes audio dev.
Engine::mixer()->changeQuality( m_oldQualitySettings );
}
// little help-function for getting file-format from a file-extension (only for
// registered file-encoders)
// Little help function for getting file format from a file extension
// (only for registered file-encoders).
ProjectRenderer::ExportFileFormats ProjectRenderer::getFileFormatFromExtension(
const QString & _ext )
{
@@ -131,7 +131,7 @@ ProjectRenderer::ExportFileFormats ProjectRenderer::getFileFormatFromExtension(
++idx;
}
return( WaveFile ); // default
return( WaveFile ); // Default.
}
@@ -151,9 +151,8 @@ void ProjectRenderer::startProcessing()
if( isReady() )
{
// have to do mixer stuff with GUI-thread-affinity in order to
// make slots connected to sampleRateChanged()-signals being
// called immediately
// Have to do mixer stuff with GUI-thread affinity in order to
// make slots connected to sampleRateChanged()-signals being called immediately.
Engine::mixer()->setAudioDevice( m_fileDev,
m_qualitySettings, false );
@@ -183,7 +182,7 @@ void ProjectRenderer::run()
Engine::getSong()->startExport();
Engine::getSong()->updateLength();
//skip first empty buffer
// Skip first empty buffer.
Engine::mixer()->nextBuffer();
const Song::PlayPos & exportPos = Engine::getSong()->getPlayPos(
@@ -194,7 +193,7 @@ void ProjectRenderer::run()
tick_t endTick = exportEndpoints.second.getTicks();
tick_t lengthTicks = endTick - startTick;
// Continually track and emit progress percentage to listeners
// Continually track and emit progress percentage to listeners.
while( exportPos.getTicks() < endTick &&
Engine::getSong()->isExporting() == true
&& !m_abort )
@@ -208,12 +207,12 @@ void ProjectRenderer::run()
}
}
// notify mixer of the end of processing
// Notify mixer of the end of processing.
Engine::mixer()->stopProcessing();
Engine::getSong()->stopExport();
// if the user aborted export-process, the file has to be deleted
// If the user aborted export-process, the file has to be deleted.
const QString f = m_fileDev->outputFile();
if( m_abort )
{
@@ -256,4 +255,3 @@ void ProjectRenderer::updateConsoleProgress()
}

View File

@@ -47,7 +47,7 @@ ExportProjectDialog::ExportProjectDialog( const QString & _file_name,
setWindowTitle( tr( "Export project to %1" ).arg(
QFileInfo( _file_name ).fileName() ) );
// get the extension of the chosen file
// Get the extension of the chosen file.
QStringList parts = _file_name.split( '.' );
QString fileExt;
if( parts.size() > 0 )
@@ -60,16 +60,16 @@ ExportProjectDialog::ExportProjectDialog( const QString & _file_name,
{
if( ProjectRenderer::fileEncodeDevices[i].isAvailable() )
{
// get the extension of this format
// Get the extension of this format.
QString renderExt = ProjectRenderer::fileEncodeDevices[i].m_extension;
// add to combo box
// Add to combo box.
fileFormatCB->addItem( ProjectRenderer::tr(
ProjectRenderer::fileEncodeDevices[i].m_description ),
QVariant(ProjectRenderer::fileEncodeDevices[i].m_fileFormat) // format tag; later used for identification
QVariant( ProjectRenderer::fileEncodeDevices[i].m_fileFormat ) // Format tag; later used for identification.
);
// if this is our extension, select it
// If this is our extension, select it.
if( QString::compare( renderExt, fileExt,
Qt::CaseInsensitive ) == 0 )
{
@@ -84,9 +84,8 @@ ExportProjectDialog::ExportProjectDialog( const QString & _file_name,
for(int i=0; i<=MAX_LEVEL; ++i)
{
QString info="";
if (i==0){ info = tr("(fastest)"); }
else if (i==4){ info = tr("(default)"); }
else if (i==MAX_LEVEL){ info = tr("(smallest)"); }
if ( i==0 ){ info = tr( "( Fastest - biggest )" ); }
else if ( i==MAX_LEVEL ){ info = tr( "( Slowest - smallest )" ); }
compLevelCB->addItem(
QString::number(i)+" "+info,
@@ -95,7 +94,7 @@ ExportProjectDialog::ExportProjectDialog( const QString & _file_name,
}
compLevelCB->setCurrentIndex(MAX_LEVEL/2);
#ifndef LMMS_HAVE_SF_COMPLEVEL
//Disable this widget; the setting would be ignored by the renderer.
// Disable this widget; the setting would be ignored by the renderer.
compressionWidget->setVisible(false);
#endif
@@ -175,8 +174,8 @@ void ExportProjectDialog::startExport()
os.setCompressionLevel(level);
}
//Make sure we have the the correct file extension
//so there's no confusion about the codec in use.
// Make sure we have the the correct file extension
// so there's no confusion about the codec in use.
auto output_name = m_fileName;
if (!(m_multiExport || output_name.endsWith(m_fileExtension,Qt::CaseInsensitive)))
{
@@ -190,9 +189,9 @@ void ExportProjectDialog::startExport()
connect( m_renderManager.get(), SIGNAL( progressChanged( int ) ),
progressBar, SLOT( setValue( int ) ) );
connect( m_renderManager.get(), SIGNAL( progressChanged( int ) ),
this, SLOT( updateTitleBar( int ) )) ;
this, SLOT( updateTitleBar( int ) ));
connect( m_renderManager.get(), SIGNAL( finished() ),
this, SLOT( accept() ) );
this, SLOT( accept() ) ) ;
connect( m_renderManager.get(), SIGNAL( finished() ),
gui->mainWindow(), SLOT( resetWindowTitle() ) );
@@ -250,7 +249,7 @@ void ExportProjectDialog::startBtnClicked()
{
m_ft = ProjectRenderer::NumFileFormats;
//Get file format from current menu selection.
// Get file format from current menu selection.
bool successful_conversion = false;
QVariant tag = fileFormatCB->itemData(fileFormatCB->currentIndex());
m_ft = static_cast<ProjectRenderer::ExportFileFormats>(

View File

@@ -6,20 +6,21 @@
<rect>
<x>0</x>
<y>0</y>
<width>558</width>
<height>357</height>
<width>504</width>
<height>286</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>558</width>
<height>357</height>
<width>504</width>
<height>286</height>
</size>
</property>
<property name="windowTitle">
<string>About LMMS</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<!--
<property name="spacing">
<number>8</number>
</property>
@@ -35,6 +36,7 @@
<property name="bottomMargin">
<number>8</number>
</property>
-->
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
@@ -46,7 +48,6 @@
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
@@ -65,7 +66,7 @@
<item>
<widget class="QLabel" name="versionLabel">
<property name="text">
<string>Version %1 (%2/%3, Qt %4, %5)</string>
<string>Version %1 (%2/%3, Qt %4, %5).</string>
</property>
</widget>
</item>
@@ -78,8 +79,8 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
@@ -106,8 +107,8 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
@@ -115,7 +116,7 @@
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>LMMS - easy music production for everyone</string>
<string>LMMS - easy music production for everyone.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
@@ -132,8 +133,8 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
@@ -141,7 +142,7 @@
<item>
<widget class="QLabel" name="copyrightLabel">
<property name="text">
<string>Copyright © %1</string>
<string>Copyright © %1.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
@@ -158,8 +159,8 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
@@ -167,7 +168,7 @@
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;https://lmms.io&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;https://lmms.io&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;https://lmms.io&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#33cc33;&quot;&gt;https://lmms.io&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
@@ -181,8 +182,8 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
@@ -236,7 +237,6 @@
</property>
<property name="plainText">
<string>Current language not translated (or native English).
If you're interested in translating LMMS in another language or want to improve existing translations, you're welcome to help us! Simply contact the maintainer!</string>
</property>
</widget>
@@ -278,6 +278,7 @@ If you're interested in translating LMMS in another language or want to improve
<signal>accepted()</signal>
<receiver>AboutDialog</receiver>
<slot>accept()</slot>
<!--
<hints>
<hint type="sourcelabel">
<x>248</x>
@@ -288,12 +289,14 @@ If you're interested in translating LMMS in another language or want to improve
<y>274</y>
</hint>
</hints>
-->
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>AboutDialog</receiver>
<slot>reject()</slot>
<!--
<hints>
<hint type="sourcelabel">
<x>316</x>
@@ -304,6 +307,7 @@ If you're interested in translating LMMS in another language or want to improve
<y>274</y>
</hint>
</hints>
-->
</connection>
</connections>
</ui>

View File

@@ -6,34 +6,56 @@
<rect>
<x>0</x>
<y>0</y>
<width>715</width>
<height>491</height>
<width>379</width>
<height>374</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>519</width>
<height>412</height>
<width>379</width>
<height>374</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>379</width>
<height>374</height>
</size>
</property>
<property name="windowTitle">
<string>Export project</string>
</property>
<layout class="QVBoxLayout">
<item>
<widget class="QCheckBox" name="exportLoopCB">
<property name="text">
<string>Export as loop (remove extra bar)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="renderMarkersCB">
<property name="text">
<string>Export between loop markers</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QGroupBox" name="outputGroupBox">
<property name="title">
<string>Output</string>
<string>File format settings</string>
</property>
<layout class="QVBoxLayout">
<!--
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>9</number>
</property>
-->
<item>
<widget class="QLabel" name="label">
<property name="text">
@@ -62,7 +84,7 @@
<item>
<widget class="QLabel" name="labelSampleRate">
<property name="text">
<string>Samplerate:</string>
<string>Sampling rate:</string>
</property>
</widget>
</item>
@@ -100,12 +122,14 @@
</item>
<item>
<widget class="QWidget" name="depthWidget" native="true">
<!--
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
-->
<layout class="QVBoxLayout">
<property name="leftMargin">
<number>0</number>
@@ -122,7 +146,7 @@
<item>
<widget class="QLabel" name="labelBitDepth">
<property name="text">
<string>Depth:</string>
<string>Bit depth:</string>
</property>
</widget>
</item>
@@ -133,17 +157,17 @@
</property>
<item>
<property name="text">
<string>16 Bit Integer</string>
<string>16 Bit integer</string>
</property>
</item>
<item>
<property name="text">
<string>24 Bit Integer</string>
<string>24 Bit integer</string>
</property>
</item>
<item>
<property name="text">
<string>32 Bit Float</string>
<string>32 Bit float</string>
</property>
</item>
</widget>
@@ -178,6 +202,11 @@
<property name="currentIndex">
<number>1</number>
</property>
<item>
<property name="text">
<string>Mono</string>
</property>
</item>
<item>
<property name="text">
<string>Stereo</string>
@@ -185,12 +214,7 @@
</item>
<item>
<property name="text">
<string>Joint Stereo</string>
</property>
</item>
<item>
<property name="text">
<string>Mono</string>
<string>Joint stereo</string>
</property>
</item>
</widget>
@@ -225,9 +249,11 @@
<property name="currentIndex">
<number>-1</number>
</property>
<!--
<property name="maxVisibleItems">
<number>9</number>
</property>
-->
</widget>
</item>
</layout>
@@ -236,9 +262,11 @@
<item>
<widget class="QWidget" name="bitrateWidget" native="true">
<layout class="QVBoxLayout">
<!--
<property name="spacing">
<number>6</number>
</property>
-->
<property name="leftMargin">
<number>0</number>
</property>
@@ -312,8 +340,8 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>163</width>
<height>20</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
@@ -341,22 +369,22 @@
</property>
<item>
<property name="text">
<string>Zero Order Hold</string>
<string>Zero order hold</string>
</property>
</item>
<item>
<property name="text">
<string>Sinc Fastest</string>
<string>Sinc worst (fastest)</string>
</property>
</item>
<item>
<property name="text">
<string>Sinc Medium (recommended)</string>
<string>Sinc medium (recommended)</string>
</property>
</item>
<item>
<property name="text">
<string>Sinc Best (very slow!)</string>
<string>Sinc best (slowest)</string>
</property>
</item>
</widget>
@@ -364,7 +392,7 @@
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Oversampling (use with care!):</string>
<string>Oversampling:</string>
</property>
</widget>
</item>
@@ -392,20 +420,6 @@
</item>
</widget>
</item>
<item>
<widget class="QCheckBox" name="exportLoopCB">
<property name="text">
<string>Export as loop (remove end silence)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="renderMarkersCB">
<property name="text">
<string>Export between loop markers</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
@@ -413,8 +427,8 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
@@ -433,8 +447,8 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>