Use the MediaInfo model in MainWindow too

This commit is contained in:
LoRd_MuldeR 2010-11-10 19:44:51 +01:00
parent 6a480fd764
commit c80714b829
9 changed files with 364 additions and 532 deletions

View File

@ -93,7 +93,7 @@
<Tool <Tool
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
Description="Copy plugin DLL&apos;s" Description="Copy plugin DLL&apos;s"
CommandLine="mkdir &quot;$(TargetDir)\imageformats&quot;&#x0D;&#x0A;copy &quot;$(QTDIR)\plugins\imageformats\q???d4.dll&quot; &quot;$(TargetDir)\imageformats\&quot;&#x0D;&#x0A;" CommandLine="mkdir &quot;$(TargetDir)imageformats&quot;&#x0D;&#x0A;copy &quot;$(QTDIR)\plugins\imageformats\q???d4.dll&quot; &quot;$(TargetDir)imageformats\&quot;&#x0D;&#x0A;"
/> />
</Configuration> </Configuration>
<Configuration <Configuration
@ -183,7 +183,7 @@
<Tool <Tool
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
Description="Copy plugin DLL&apos;s" Description="Copy plugin DLL&apos;s"
CommandLine="mkdir &quot;$(TargetDir)\imageformats&quot;&#x0D;&#x0A;copy &quot;$(QTDIR)\plugins\imageformats\q???4.dll&quot; &quot;$(TargetDir)\imageformats\&quot;&#x0D;&#x0A;" CommandLine="mkdir &quot;$(TargetDir)imageformats&quot;&#x0D;&#x0A;copy &quot;$(QTDIR)\plugins\imageformats\q???4.dll&quot; &quot;$(TargetDir)imageformats\&quot;&#x0D;&#x0A;"
/> />
</Configuration> </Configuration>
</Configurations> </Configurations>
@ -261,6 +261,10 @@
Filter="h;hpp;hxx;hm;inl;inc;xsd" Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
> >
<File
RelativePath=".\src\Config.h"
>
</File>
<File <File
RelativePath=".\src\Dialog_MainWindow.h" RelativePath=".\src\Dialog_MainWindow.h"
> >

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>676</width> <width>676</width>
<height>557</height> <height>550</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -198,19 +198,19 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="buttonEditMeta"> <widget class="QPushButton" name="buttonShowDetails">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>90</width> <width>105</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string> Edit Meta</string> <string>Show Details</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../res/Icons.qrc"> <iconset resource="../res/Icons.qrc">
<normaloff>:/icons/table_edit.png</normaloff>:/icons/table_edit.png</iconset> <normaloff>:/icons/zoom.png</normaloff>:/icons/zoom.png</iconset>
</property> </property>
</widget> </widget>
</item> </item>
@ -380,7 +380,7 @@
<layout class="QGridLayout" name="gridLayout_6"> <layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0"> <item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_5"> <layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0" colspan="2"> <item row="0" column="1" colspan="2">
<widget class="QGroupBox" name="metaDataGroupBox"> <widget class="QGroupBox" name="metaDataGroupBox">
<property name="font"> <property name="font">
<font> <font>
@ -392,448 +392,95 @@
<string> Meta Information </string> <string> Meta Information </string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_9"> <layout class="QGridLayout" name="gridLayout_9">
<item row="3" column="0"> <item row="0" column="0" colspan="4">
<layout class="QGridLayout" name="gridLayout"> <widget class="QTableView" name="metaDataView">
<item row="1" column="0"> <property name="selectionMode">
<widget class="QLineEdit" name="lineEdit"> <enum>QAbstractItemView::SingleSelection</enum>
<property name="palette">
<palette>
<active>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>85</red>
<green>85</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>85</red>
<green>85</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property> </property>
<property name="text"> <property name="selectionBehavior">
<string>(Copy from Source File)</string> <enum>QAbstractItemView::SelectRows</enum>
</property> </property>
<property name="readOnly"> <property name="wordWrap">
<bool>false</bool>
</property>
<attribute name="horizontalHeaderHighlightSections">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool> <bool>true</bool>
</property> </attribute>
</widget> <attribute name="verticalHeaderHighlightSections">
</item> <bool>false</bool>
<item row="0" column="0"> </attribute>
<widget class="QLabel" name="label">
<property name="text">
<string>Artist:</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLineEdit" name="lineEdit_2">
<property name="palette">
<palette>
<active>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>85</red>
<green>85</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>85</red>
<green>85</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>(Copy from Source File)</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Album:</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLineEdit" name="lineEdit_4">
<property name="palette">
<palette>
<active>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>85</red>
<green>85</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>85</red>
<green>85</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>(Copy from Source File)</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QLineEdit" name="lineEdit_3">
<property name="palette">
<palette>
<active>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>85</red>
<green>85</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>85</red>
<green>85</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>(Copy from Source File)</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Genre:</string>
</property>
</widget> </widget>
</item> </item>
<item row="3" column="3"> <item row="3" column="3">
<widget class="QLabel" name="label_6"> <widget class="QPushButton" name="buttonEditMeta">
<property name="text">
<string>Year:</string>
</property>
</widget>
</item>
<item row="2" column="2">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>4</width>
<height>2</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="pushButton">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>32</width> <width>90</width>
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string>...</string> <string>Edit</string>
</property>
<property name="icon">
<iconset resource="../res/Icons.qrc">
<normaloff>:/icons/table_edit.png</normaloff>:/icons/table_edit.png</iconset>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="3" column="1">
<widget class="QPushButton" name="pushButton_2"> <widget class="QLabel" name="labelEditMetaHint">
<property name="maximumSize">
<size>
<width>32</width>
<height>16777215</height>
</size>
</property>
<property name="text"> <property name="text">
<string>...</string> <string>Note: Meta information you enter here will &lt;u&gt;supersede&lt;/u&gt; data from the source!</string>
</property> </property>
</widget> <property name="wordWrap">
</item>
<item row="1" column="4">
<widget class="QPushButton" name="pushButton_3">
<property name="maximumSize">
<size>
<width>32</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="4" column="4">
<widget class="QPushButton" name="pushButton_4">
<property name="maximumSize">
<size>
<width>32</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLineEdit" name="lineEdit_5">
<property name="palette">
<palette>
<active>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>85</red>
<green>85</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>85</red>
<green>85</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>(Copy from Source File)</string>
</property>
<property name="readOnly">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="0"> <item row="3" column="0">
<widget class="QLabel" name="label_7"> <widget class="QLabel" name="labelEditMetaIcon">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string>Comment:</string> <string/>
</property>
<property name="pixmap">
<pixmap resource="../res/Icons.qrc">:/icons/feed.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="2"> <item row="3" column="2">
<spacer name="verticalSpacer_6"> <widget class="QPushButton" name="buttonClearMeta">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>4</width>
<height>2</height>
</size>
</property>
</spacer>
</item>
<item row="7" column="1">
<widget class="QPushButton" name="pushButton_5">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>32</width> <width>90</width>
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string>...</string> <string>Reset</string>
</property> </property>
</widget> <property name="icon">
</item> <iconset resource="../res/Icons.qrc">
<item row="7" column="3"> <normaloff>:/icons/bomb.png</normaloff>:/icons/bomb.png</iconset>
<widget class="QLineEdit" name="lineEdit_6">
<property name="palette">
<palette>
<active>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>85</red>
<green>85</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>85</red>
<green>85</green>
<blue>127</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>120</red>
<green>120</green>
<blue>120</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>(Copy from Source File)</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="7" column="4">
<widget class="QPushButton" name="pushButton_6">
<property name="maximumSize">
<size>
<width>32</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="6" column="3">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Position:</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item>
</layout>
</widget> </widget>
</item> </item>
<item row="1" column="0" rowspan="2" colspan="2"> <item row="1" column="1" rowspan="2" colspan="2">
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="font"> <property name="font">
<font> <font>
@ -847,7 +494,7 @@
<layout class="QGridLayout" name="gridLayout_11"> <layout class="QGridLayout" name="gridLayout_11">
<item row="0" column="0"> <item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_10"> <layout class="QGridLayout" name="gridLayout_10">
<item row="0" column="2"> <item row="0" column="1">
<widget class="QCheckBox" name="generatePlaylistCheckBox"> <widget class="QCheckBox" name="generatePlaylistCheckBox">
<property name="font"> <property name="font">
<font> <font>
@ -879,22 +526,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1">
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>4</width>
<height>2</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>
@ -902,19 +533,6 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="3" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tabCompressionSetting"> <widget class="QWidget" name="tabCompressionSetting">
@ -1431,6 +1049,9 @@
<include location="../res/Images.qrc"/> <include location="../res/Images.qrc"/>
<include location="../res/Images.qrc"/> <include location="../res/Images.qrc"/>
<include location="../res/Images.qrc"/> <include location="../res/Images.qrc"/>
<include location="../res/Images.qrc"/>
<include location="../res/Icons.qrc"/>
<include location="../res/Images.qrc"/>
</resources> </resources>
<connections> <connections>
<connection> <connection>
@ -1500,7 +1121,7 @@
<connection> <connection>
<sender>sourceFileView</sender> <sender>sourceFileView</sender>
<signal>doubleClicked(QModelIndex)</signal> <signal>doubleClicked(QModelIndex)</signal>
<receiver>buttonEditMeta</receiver> <receiver>buttonShowDetails</receiver>
<slot>click()</slot> <slot>click()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
@ -1628,7 +1249,7 @@
<connection> <connection>
<sender>writeMetaDataCheckBox</sender> <sender>writeMetaDataCheckBox</sender>
<signal>clicked(bool)</signal> <signal>clicked(bool)</signal>
<receiver>metaDataGroupBox</receiver> <receiver>metaDataView</receiver>
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
@ -1637,7 +1258,87 @@
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>336</x> <x>336</x>
<y>160</y> <y>252</y>
</hint>
</hints>
</connection>
<connection>
<sender>writeMetaDataCheckBox</sender>
<signal>clicked(bool)</signal>
<receiver>buttonEditMeta</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>183</x>
<y>465</y>
</hint>
<hint type="destinationlabel">
<x>596</x>
<y>404</y>
</hint>
</hints>
</connection>
<connection>
<sender>writeMetaDataCheckBox</sender>
<signal>clicked(bool)</signal>
<receiver>labelEditMetaHint</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>183</x>
<y>465</y>
</hint>
<hint type="destinationlabel">
<x>299</x>
<y>404</y>
</hint>
</hints>
</connection>
<connection>
<sender>writeMetaDataCheckBox</sender>
<signal>clicked(bool)</signal>
<receiver>labelEditMetaIcon</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>183</x>
<y>465</y>
</hint>
<hint type="destinationlabel">
<x>39</x>
<y>404</y>
</hint>
</hints>
</connection>
<connection>
<sender>metaDataView</sender>
<signal>doubleClicked(QModelIndex)</signal>
<receiver>buttonEditMeta</receiver>
<slot>click()</slot>
<hints>
<hint type="sourcelabel">
<x>336</x>
<y>237</y>
</hint>
<hint type="destinationlabel">
<x>596</x>
<y>404</y>
</hint>
</hints>
</connection>
<connection>
<sender>writeMetaDataCheckBox</sender>
<signal>clicked(bool)</signal>
<receiver>buttonClearMeta</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>183</x>
<y>465</y>
</hint>
<hint type="destinationlabel">
<x>500</x>
<y>404</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>

View File

@ -46,5 +46,6 @@
<file>icons/transmit_blue.png</file> <file>icons/transmit_blue.png</file>
<file>icons/user.png</file> <file>icons/user.png</file>
<file>icons/world.png</file> <file>icons/world.png</file>
<file>icons/zoom.png</file>
</qresource> </qresource>
</RCC> </RCC>

43
src/Config.h Normal file
View File

@ -0,0 +1,43 @@
///////////////////////////////////////////////////////////////////////////////
// LameXP - Audio Encoder Front-End
// Copyright (C) 2004-2010 LoRd_MuldeR <MuldeR2@GMX.de>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
// http://www.gnu.org/licenses/gpl-2.0.txt
///////////////////////////////////////////////////////////////////////////////
/*
* LameXP Version Info
*/
#define VER_LAMEXP_MAJOR 4
#define VER_LAMEXP_MINOR_HI 0
#define VER_LAMEXP_MINOR_LO 0
#define VER_LAMEXP_BUILD 10
#define VER_LAMEXP_SUFFIX TechPreview
/*
* Helper macros (aka: having fun with the C pre-processor)
*/
#define VER_LAMEXP_STR_HLP1(X) #X
#define VER_LAMEXP_STR_HLP2(V,W,X,Y,Z) VER_LAMEXP_STR_HLP1(v##V.W##X Z [Build Y])
#define VER_LAMEXP_STR_HLP3(V,W,X,Y,Z) VER_LAMEXP_STR_HLP2(V,W,X,Y,Z)
#define VER_LAMEXP_STR VER_LAMEXP_STR_HLP3(VER_LAMEXP_MAJOR,VER_LAMEXP_MINOR_HI,VER_LAMEXP_MINOR_LO,VER_LAMEXP_BUILD,VER_LAMEXP_SUFFIX)
#define VER_LAMEXP_SUFFIX_STR_HLP1(X) #X
#define VER_LAMEXP_SUFFIX_STR_HLP2(X) VER_LAMEXP_SUFFIX_STR_HLP1(X)
#define VER_LAMEXP_SUFFIX_STR VER_LAMEXP_SUFFIX_STR_HLP2(VER_LAMEXP_SUFFIX)
#define VER_LAMEXP_MINOR_HLP1(X,Y) X##Y
#define VER_LAMEXP_MINOR_HLP2(X,Y) VER_LAMEXP_MINOR_HLP1(X,Y)
#define VER_LAMEXP_MINOR VER_LAMEXP_MINOR_HLP2(VER_LAMEXP_MINOR_HI,VER_LAMEXP_MINOR_LO)

View File

@ -28,6 +28,7 @@
#include "Dialog_MetaInfo.h" #include "Dialog_MetaInfo.h"
#include "Thread_FileAnalyzer.h" #include "Thread_FileAnalyzer.h"
#include "Thread_MessageHandler.h" #include "Thread_MessageHandler.h"
#include "Model_MetaInfo.h"
//Qt includes //Qt includes
#include <QMessageBox> #include <QMessageBox>
@ -47,7 +48,14 @@
//Win32 includes //Win32 includes
#include <Windows.h> #include <Windows.h>
//Helper macros
#define LINK(URL) QString("<a href=\"%1\">%2</a>").arg(URL).arg(URL) #define LINK(URL) QString("<a href=\"%1\">%2</a>").arg(URL).arg(URL)
#define ABORT_IF_BUSY \
if(m_banner->isVisible() || m_delayedFileTimer->isActive()) \
{ \
MessageBeep(MB_ICONEXCLAMATION); \
return; \
} \
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Constructor // Constructor
@ -86,7 +94,7 @@ MainWindow::MainWindow(QWidget *parent)
connect(buttonClearFiles, SIGNAL(clicked()), this, SLOT(clearFilesButtonClicked())); connect(buttonClearFiles, SIGNAL(clicked()), this, SLOT(clearFilesButtonClicked()));
connect(buttonFileUp, SIGNAL(clicked()), this, SLOT(fileUpButtonClicked())); connect(buttonFileUp, SIGNAL(clicked()), this, SLOT(fileUpButtonClicked()));
connect(buttonFileDown, SIGNAL(clicked()), this, SLOT(fileDownButtonClicked())); connect(buttonFileDown, SIGNAL(clicked()), this, SLOT(fileDownButtonClicked()));
connect(buttonEditMeta, SIGNAL(clicked()), this, SLOT(editMetaButtonClicked())); connect(buttonShowDetails, SIGNAL(clicked()), this, SLOT(showDetailsButtonClicked()));
//Setup "Output" tab //Setup "Output" tab
m_fileSystemModel = new QFileSystemModel(); m_fileSystemModel = new QFileSystemModel();
@ -107,6 +115,17 @@ MainWindow::MainWindow(QWidget *parent)
connect(buttonGotoDesktop, SIGNAL(clicked()), this, SLOT(gotoDesktopButtonClicked())); connect(buttonGotoDesktop, SIGNAL(clicked()), this, SLOT(gotoDesktopButtonClicked()));
connect(buttonGotoMusic, SIGNAL(clicked()), this, SLOT(gotoMusicFolderButtonClicked())); connect(buttonGotoMusic, SIGNAL(clicked()), this, SLOT(gotoMusicFolderButtonClicked()));
//Setup "Meta Data" tab
m_metaData = new AudioFileModel();
m_metaInfoModel = new MetaInfoModel(m_metaData, 6);
m_metaInfoModel->clearData();
metaDataView->setModel(m_metaInfoModel);
metaDataView->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
metaDataView->verticalHeader()->hide();
metaDataView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
connect(buttonEditMeta, SIGNAL(clicked()), this, SLOT(editMetaButtonClicked()));
connect(buttonClearMeta, SIGNAL(clicked()), this, SLOT(clearMetaButtonClicked()));
//Activate file menu actions //Activate file menu actions
connect(actionOpenFolder, SIGNAL(triggered()), this, SLOT(openFolderActionActivated())); connect(actionOpenFolder, SIGNAL(triggered()), this, SLOT(openFolderActionActivated()));
@ -171,6 +190,10 @@ MainWindow::~MainWindow(void)
} }
} }
//Unset models
sourceFileView->setModel(NULL);
metaDataView->setModel(NULL);
//Free memory //Free memory
LAMEXP_DELETE(m_tabActionGroup); LAMEXP_DELETE(m_tabActionGroup);
LAMEXP_DELETE(m_styleActionGroup); LAMEXP_DELETE(m_styleActionGroup);
@ -180,6 +203,8 @@ MainWindow::~MainWindow(void)
LAMEXP_DELETE(m_messageHandler); LAMEXP_DELETE(m_messageHandler);
LAMEXP_DELETE(m_delayedFileList); LAMEXP_DELETE(m_delayedFileList);
LAMEXP_DELETE(m_delayedFileTimer); LAMEXP_DELETE(m_delayedFileTimer);
LAMEXP_DELETE(m_metaData);
LAMEXP_DELETE(m_metaInfoModel);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@ -236,8 +261,9 @@ void MainWindow::windowShown(void)
*/ */
void MainWindow::aboutButtonClicked(void) void MainWindow::aboutButtonClicked(void)
{ {
QString aboutText; ABORT_IF_BUSY;
QString aboutText;
aboutText += "<h2>LameXP - Audio Encoder Front-end</h2>"; aboutText += "<h2>LameXP - Audio Encoder Front-end</h2>";
aboutText += QString("<b>Copyright (C) 2004-%1 LoRd_MuldeR &lt;MuldeR2@GMX.de&gt;. Some rights reserved.</b><br>").arg(max(lamexp_version_date().year(),QDate::currentDate().year())); aboutText += QString("<b>Copyright (C) 2004-%1 LoRd_MuldeR &lt;MuldeR2@GMX.de&gt;. Some rights reserved.</b><br>").arg(max(lamexp_version_date().year(),QDate::currentDate().year()));
aboutText += QString().sprintf("<b>Version %d.%02d %s, Build %d [%s]</b><br><br>", lamexp_version_major(), lamexp_version_minor(), lamexp_version_release(), lamexp_version_build(), lamexp_version_date().toString(Qt::ISODate).toLatin1().constData()); aboutText += QString().sprintf("<b>Version %d.%02d %s, Build %d [%s]</b><br><br>", lamexp_version_major(), lamexp_version_minor(), lamexp_version_release(), lamexp_version_build(), lamexp_version_date().toString(Qt::ISODate).toLatin1().constData());
@ -330,13 +356,7 @@ void MainWindow::aboutButtonClicked(void)
*/ */
void MainWindow::encodeButtonClicked(void) void MainWindow::encodeButtonClicked(void)
{ {
if(m_delayedFileTimer->isActive()) ABORT_IF_BUSY;
{
MessageBeep(MB_ICONERROR);
return;
}
QMessageBox::warning(this, "LameXP", "Not implemented yet, please try again with a later version!"); QMessageBox::warning(this, "LameXP", "Not implemented yet, please try again with a later version!");
} }
@ -345,6 +365,8 @@ void MainWindow::encodeButtonClicked(void)
*/ */
void MainWindow::addFilesButtonClicked(void) void MainWindow::addFilesButtonClicked(void)
{ {
ABORT_IF_BUSY;
tabWidget->setCurrentIndex(0); tabWidget->setCurrentIndex(0);
QStringList selectedFiles = QFileDialog::getOpenFileNames(this, "Add file(s)", QString(), "All supported files (*.*)"); QStringList selectedFiles = QFileDialog::getOpenFileNames(this, "Add file(s)", QString(), "All supported files (*.*)");
@ -369,6 +391,8 @@ void MainWindow::addFilesButtonClicked(void)
*/ */
void MainWindow::openFolderActionActivated(void) void MainWindow::openFolderActionActivated(void)
{ {
ABORT_IF_BUSY;
tabWidget->setCurrentIndex(0); tabWidget->setCurrentIndex(0);
QString selectedFolder = QFileDialog::getExistingDirectory(this, "Add folder", QDesktopServices::storageLocation(QDesktopServices::MusicLocation)); QString selectedFolder = QFileDialog::getExistingDirectory(this, "Add folder", QDesktopServices::storageLocation(QDesktopServices::MusicLocation));
@ -443,10 +467,12 @@ void MainWindow::fileDownButtonClicked(void)
} }
/* /*
* Edit meta button * Show details button
*/ */
void MainWindow::editMetaButtonClicked(void) void MainWindow::showDetailsButtonClicked(void)
{ {
ABORT_IF_BUSY;
int iResult = 0; int iResult = 0;
MetaInfoDialog *metaInfoDialog = new MetaInfoDialog(this); MetaInfoDialog *metaInfoDialog = new MetaInfoDialog(this);
QModelIndex index = sourceFileView->currentIndex(); QModelIndex index = sourceFileView->currentIndex();
@ -574,6 +600,8 @@ void MainWindow::gotoMusicFolderButtonClicked(void)
*/ */
void MainWindow::makeFolderButtonClicked(void) void MainWindow::makeFolderButtonClicked(void)
{ {
ABORT_IF_BUSY;
QDir basePath(m_fileSystemModel->filePath(outputFolderView->currentIndex())); QDir basePath(m_fileSystemModel->filePath(outputFolderView->currentIndex()));
bool bApplied = true; bool bApplied = true;
@ -614,6 +642,23 @@ void MainWindow::makeFolderButtonClicked(void)
} }
} }
/*
* Edit meta button clicked
*/
void MainWindow::editMetaButtonClicked(void)
{
ABORT_IF_BUSY;
m_metaInfoModel->editItem(metaDataView->currentIndex(), this);
}
/*
* Reset meta button clicked
*/
void MainWindow::clearMetaButtonClicked(void)
{
ABORT_IF_BUSY;
m_metaInfoModel->clearData();
}
/* /*
* Visit homepage action * Visit homepage action
@ -628,6 +673,8 @@ void MainWindow::visitHomepageActionActivated(void)
*/ */
void MainWindow::checkUpdatesActionActivated(void) void MainWindow::checkUpdatesActionActivated(void)
{ {
ABORT_IF_BUSY;
m_banner->show("Checking for updates, please be patient..."); m_banner->show("Checking for updates, please be patient...");
for(int i = 0; i < 300; i++) for(int i = 0; i < 300; i++)

View File

@ -29,6 +29,8 @@
class QFileSystemModel; class QFileSystemModel;
class WorkingBanner; class WorkingBanner;
class MessageHandlerThread; class MessageHandlerThread;
class AudioFileModel;
class MetaInfoModel;
class MainWindow: public QMainWindow, private Ui::MainWindow class MainWindow: public QMainWindow, private Ui::MainWindow
{ {
@ -47,7 +49,7 @@ private slots:
void removeFileButtonClicked(void); void removeFileButtonClicked(void);
void fileDownButtonClicked(void); void fileDownButtonClicked(void);
void fileUpButtonClicked(void); void fileUpButtonClicked(void);
void editMetaButtonClicked(void); void showDetailsButtonClicked(void);
void tabPageChanged(int idx); void tabPageChanged(int idx);
void tabActionActivated(QAction *action); void tabActionActivated(QAction *action);
void styleActionActivated(QAction *action); void styleActionActivated(QAction *action);
@ -62,6 +64,8 @@ private slots:
void notifyOtherInstance(void); void notifyOtherInstance(void);
void addFileDelayed(const QString &filePath); void addFileDelayed(const QString &filePath);
void handleDelayedFiles(void); void handleDelayedFiles(void);
void editMetaButtonClicked(void);
void clearMetaButtonClicked(void);
protected: protected:
void showEvent(QShowEvent *event); void showEvent(QShowEvent *event);
@ -75,4 +79,6 @@ private:
MessageHandlerThread *m_messageHandler; MessageHandlerThread *m_messageHandler;
QStringList *m_delayedFileList; QStringList *m_delayedFileList;
QTimer *m_delayedFileTimer; QTimer *m_delayedFileTimer;
AudioFileModel *m_metaData;
MetaInfoModel *m_metaInfoModel;
}; };

View File

@ -25,8 +25,10 @@
#include <QMessageBox> #include <QMessageBox>
#include <QInputDialog> #include <QInputDialog>
#define CHECK1(STR) (STR.isEmpty() ? "(Unknown)" : STR) #define MODEL_ROW_COUNT 12
#define CHECK2(VAL) ((VAL > 0) ? QString::number(VAL) : "(Unknown)")
#define CHECK1(STR) (STR.isEmpty() ? (m_offset ? "(Not Specified)" : "(Unknown)") : STR)
#define CHECK2(VAL) ((VAL > 0) ? QString::number(VAL) : (m_offset ? "(Not Specified)" : "(Unknown)"))
#define CHECK3(STR) (STR.isEmpty() ? Qt::darkGray : QVariant()) #define CHECK3(STR) (STR.isEmpty() ? Qt::darkGray : QVariant())
#define CHECK4(VAL) ((VAL == 0) ? Qt::darkGray : QVariant()) #define CHECK4(VAL) ((VAL == 0) ? Qt::darkGray : QVariant())
@ -34,9 +36,15 @@
// Constructor & Destructor // Constructor & Destructor
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
MetaInfoModel::MetaInfoModel(AudioFileModel *file) MetaInfoModel::MetaInfoModel(AudioFileModel *file, unsigned int offset)
{ {
if(offset >= MODEL_ROW_COUNT)
{
throw "Offset is out of range!";
}
m_audioFile = file; m_audioFile = file;
m_offset = offset;
} }
MetaInfoModel::~MetaInfoModel(void) MetaInfoModel::~MetaInfoModel(void)
@ -54,14 +62,14 @@ int MetaInfoModel::columnCount(const QModelIndex &parent) const
int MetaInfoModel::rowCount(const QModelIndex &parent) const int MetaInfoModel::rowCount(const QModelIndex &parent) const
{ {
return 12; return MODEL_ROW_COUNT - m_offset;
} }
QVariant MetaInfoModel::data(const QModelIndex &index, int role) const QVariant MetaInfoModel::data(const QModelIndex &index, int role) const
{ {
if(role == Qt::DisplayRole) if(role == Qt::DisplayRole)
{ {
switch(index.row()) switch(index.row() + m_offset)
{ {
case 0: case 0:
return (!index.column()) ? "Full Path" : CHECK1(m_audioFile->filePath()); return (!index.column()) ? "Full Path" : CHECK1(m_audioFile->filePath());
@ -94,7 +102,7 @@ QVariant MetaInfoModel::data(const QModelIndex &index, int role) const
return (!index.column()) ? "Year" : CHECK2(m_audioFile->fileYear()); return (!index.column()) ? "Year" : CHECK2(m_audioFile->fileYear());
break; break;
case 10: case 10:
return (!index.column()) ? "Position" : CHECK2(m_audioFile->filePosition()); return (!index.column()) ? "Position" : ((m_audioFile->filePosition() == UINT_MAX) ? "Generate from list position" : CHECK2(m_audioFile->filePosition()));
break; break;
case 11: case 11:
return (!index.column()) ? "Comment" : CHECK1(m_audioFile->fileComment()); return (!index.column()) ? "Comment" : CHECK1(m_audioFile->fileComment());
@ -106,7 +114,7 @@ QVariant MetaInfoModel::data(const QModelIndex &index, int role) const
} }
else if(role == Qt::DecorationRole && index.column() == 0) else if(role == Qt::DecorationRole && index.column() == 0)
{ {
switch(index.row()) switch(index.row() + m_offset)
{ {
case 0: case 0:
return QIcon(":/icons/folder_page.png"); return QIcon(":/icons/folder_page.png");
@ -151,7 +159,7 @@ QVariant MetaInfoModel::data(const QModelIndex &index, int role) const
} }
else if(role == Qt::TextColorRole && index.column() == 1) else if(role == Qt::TextColorRole && index.column() == 1)
{ {
switch(index.row()) switch(index.row() + m_offset)
{ {
case 0: case 0:
return CHECK3(m_audioFile->filePath()); return CHECK3(m_audioFile->filePath());
@ -237,7 +245,7 @@ void MetaInfoModel::editItem(const QModelIndex &index, QWidget *parent)
QStringList generes("(Unspecified)"); QStringList generes("(Unspecified)");
QString temp; QString temp;
switch(index.row()) switch(index.row() + m_offset)
{ {
case 5: case 5:
temp = QInputDialog::getText(parent, "Edit Title", "Please enter the title for this file:", QLineEdit::Normal, m_audioFile->fileName(), &ok).simplified(); temp = QInputDialog::getText(parent, "Edit Title", "Please enter the title for this file:", QLineEdit::Normal, m_audioFile->fileName(), &ok).simplified();
@ -286,6 +294,8 @@ void MetaInfoModel::editItem(const QModelIndex &index, QWidget *parent)
} }
break; break;
case 10: case 10:
if(!m_offset)
{
val = QInputDialog::getInt(parent, "Edit Position", "Please enter the position (track no.) for this file:", (m_audioFile->filePosition() ? m_audioFile->filePosition() : 1), 0, 99, 1, &ok); val = QInputDialog::getInt(parent, "Edit Position", "Please enter the position (track no.) for this file:", (m_audioFile->filePosition() ? m_audioFile->filePosition() : 1), 0, 99, 1, &ok);
if(ok) if(ok)
{ {
@ -293,6 +303,20 @@ void MetaInfoModel::editItem(const QModelIndex &index, QWidget *parent)
m_audioFile->setFilePosition(val); m_audioFile->setFilePosition(val);
endResetModel(); endResetModel();
} }
}
else
{
QStringList options;
options << "Unspecified (copy from source file)";
options << "Generate from list position";
temp = QInputDialog::getItem(parent, "Edit Position", "Please enter the position (track no.) for this file:", options, ((m_audioFile->filePosition() == UINT_MAX) ? 1 : 0), false, &ok);
if(ok)
{
beginResetModel();
m_audioFile->setFilePosition((options.indexOf(temp) == 1) ? UINT_MAX : 0);
endResetModel();
}
}
break; break;
case 11: case 11:
temp = QInputDialog::getText(parent, "Edit Comment", "Please enter the comment for this file:", QLineEdit::Normal, (m_audioFile->fileComment().isEmpty() ? "Encoded with LameXP" : m_audioFile->fileComment()), &ok).simplified(); temp = QInputDialog::getText(parent, "Edit Comment", "Please enter the comment for this file:", QLineEdit::Normal, (m_audioFile->fileComment().isEmpty() ? "Encoded with LameXP" : m_audioFile->fileComment()), &ok).simplified();
@ -309,6 +333,31 @@ void MetaInfoModel::editItem(const QModelIndex &index, QWidget *parent)
} }
} }
void MetaInfoModel::clearData(void)
{
beginResetModel();
m_audioFile->setFilePath(QString());
m_audioFile->setFileName(QString());
m_audioFile->setFileArtist(QString());
m_audioFile->setFileAlbum(QString());
m_audioFile->setFileGenre(QString());
m_audioFile->setFileComment("Encoded with LameXP");
m_audioFile->setFileYear(0);
m_audioFile->setFilePosition(UINT_MAX);
m_audioFile->setFileDuration(0);
m_audioFile->setFormatContainerType(QString());
m_audioFile->setFormatContainerProfile(QString());
m_audioFile->setFormatAudioType(QString());
m_audioFile->setFormatAudioProfile(QString());
m_audioFile->setFormatAudioVersion(QString());
m_audioFile->setFormatAudioSamplerate(0);
m_audioFile->setFormatAudioChannels(0);
m_audioFile->setFormatAudioBitdepth(0);
endResetModel();
}
Qt::ItemFlags MetaInfoModel::flags(const QModelIndex &index) const Qt::ItemFlags MetaInfoModel::flags(const QModelIndex &index) const
{ {
return QAbstractTableModel::flags(index); return QAbstractTableModel::flags(index);

View File

@ -31,7 +31,7 @@ class MetaInfoModel : public QAbstractTableModel
Q_OBJECT Q_OBJECT
public: public:
MetaInfoModel(AudioFileModel *file); MetaInfoModel(AudioFileModel *file, unsigned int offset = 0);
~MetaInfoModel(void); ~MetaInfoModel(void);
//Model functions //Model functions
@ -41,7 +41,9 @@ public:
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
Qt::ItemFlags flags(const QModelIndex &index) const; Qt::ItemFlags flags(const QModelIndex &index) const;
void editItem(const QModelIndex &index, QWidget *parent); void editItem(const QModelIndex &index, QWidget *parent);
void clearData(void);
private: private:
AudioFileModel* m_audioFile; AudioFileModel* m_audioFile;
unsigned int m_offset;
}; };

View File

@ -19,14 +19,7 @@
// http://www.gnu.org/licenses/gpl-2.0.txt // http://www.gnu.org/licenses/gpl-2.0.txt
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/* #include "Config.h"
* LameXP Version Info
*/
#define VER_LAMEXP_MAJOR 4
#define VER_LAMEXP_MINOR_HI 0
#define VER_LAMEXP_MINOR_LO 0
#define VER_LAMEXP_BUILD 9
#define VER_LAMEXP_SUFFIX TechPreview
/* /*
* Resource ID's * Resource ID's
@ -45,17 +38,3 @@
#define _APS_NEXT_SYMED_VALUE 101 #define _APS_NEXT_SYMED_VALUE 101
#endif #endif
#endif #endif
/*
* Helper macros (having fun with the C pre-processor)
*/
#define VER_LAMEXP_STR_HLP1(X) #X
#define VER_LAMEXP_STR_HLP2(V,W,X,Y,Z) VER_LAMEXP_STR_HLP1(v##V.W##X Z [Build Y])
#define VER_LAMEXP_STR_HLP3(V,W,X,Y,Z) VER_LAMEXP_STR_HLP2(V,W,X,Y,Z)
#define VER_LAMEXP_STR VER_LAMEXP_STR_HLP3(VER_LAMEXP_MAJOR,VER_LAMEXP_MINOR_HI,VER_LAMEXP_MINOR_LO,VER_LAMEXP_BUILD,VER_LAMEXP_SUFFIX)
#define VER_LAMEXP_SUFFIX_STR_HLP1(X) #X
#define VER_LAMEXP_SUFFIX_STR_HLP2(X) VER_LAMEXP_SUFFIX_STR_HLP1(X)
#define VER_LAMEXP_SUFFIX_STR VER_LAMEXP_SUFFIX_STR_HLP2(VER_LAMEXP_SUFFIX)
#define VER_LAMEXP_MINOR_HLP1(X,Y) X##Y
#define VER_LAMEXP_MINOR_HLP2(X,Y) VER_LAMEXP_MINOR_HLP1(X,Y)
#define VER_LAMEXP_MINOR VER_LAMEXP_MINOR_HLP2(VER_LAMEXP_MINOR_HI,VER_LAMEXP_MINOR_LO)