Selecting files, calling mkvmerge --identify

This commit is contained in:
Moritz Bunkus 2012-04-09 20:06:44 +02:00
parent 4a9941bd64
commit 803e42a88b
14 changed files with 684 additions and 277 deletions

View File

@ -39,4 +39,15 @@ to_wide(QString const &source) {
return source.toStdWString();
}
inline void
mxinfo(QString const &s) {
mxinfo(to_utf8(s));
}
inline void
mxmsg(unsigned int level,
QString const &message) {
mxmsg(level, to_utf8(message));
}
#endif // MTX_COMMON_QT_H

View File

@ -1,7 +1,7 @@
/********************************************************************************
** Form generated from reading UI file 'main_window.ui'
**
** Created: Mon Apr 9 17:38:31 2012
** Created: Mon Apr 9 19:48:41 2012
** by: Qt User Interface Compiler version 4.7.4
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
@ -57,28 +57,15 @@ public:
QAction *action_Chapter_editor;
QAction *action_Options;
QWidget *centralWidget;
QVBoxLayout *verticalLayout_12;
QVBoxLayout *verticalLayout_2;
QTabWidget *mainTab;
QWidget *inputTab;
QHBoxLayout *horizontalLayout_2;
QVBoxLayout *verticalLayout_3;
QLabel *label;
QHBoxLayout *horizontalLayout;
QTreeView *riles;
QVBoxLayout *verticalLayout;
QPushButton *addFile;
QPushButton *appendFile;
QPushButton *removeFile;
QPushButton *removeAll;
QPushButton *multipleFileParts;
QSpacerItem *verticalSpacer;
QLabel *label;
QTreeView *files;
QLabel *label_2;
QHBoxLayout *horizontalLayout_3;
QTreeView *tracks;
QVBoxLayout *verticalLayout_2;
QPushButton *trackUp;
QPushButton *trackDown;
QSpacerItem *verticalSpacer_2;
QVBoxLayout *verticalLayout_4;
QLabel *label_3;
QScrollArea *scrollArea;
@ -212,11 +199,12 @@ public:
QPushButton *addAttachment;
QPushButton *removeAttachment;
QSpacerItem *verticalSpacer_6;
QHBoxLayout *horizontalLayout_5;
QHBoxLayout *horizontalLayout;
QSpacerItem *horizontalSpacer_2;
QPushButton *pbStartMuxing;
QPushButton *pbAddToJobQueue;
QPushButton *pbSaveSettings;
QPushButton *addFiles;
QPushButton *startMuxing;
QPushButton *addToJobQueue;
QPushButton *saveSettings;
QSpacerItem *horizontalSpacer_3;
QMenuBar *menuBar;
QMenu *menuFile;
@ -228,7 +216,7 @@ public:
{
if (MainWindow->objectName().isEmpty())
MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
MainWindow->resize(846, 571);
MainWindow->resize(780, 556);
actionNew = new QAction(MainWindow);
actionNew->setObjectName(QString::fromUtf8("actionNew"));
actionSave_job_file = new QAction(MainWindow);
@ -259,10 +247,10 @@ public:
action_Options->setObjectName(QString::fromUtf8("action_Options"));
centralWidget = new QWidget(MainWindow);
centralWidget->setObjectName(QString::fromUtf8("centralWidget"));
verticalLayout_12 = new QVBoxLayout(centralWidget);
verticalLayout_12->setSpacing(6);
verticalLayout_12->setContentsMargins(11, 11, 11, 11);
verticalLayout_12->setObjectName(QString::fromUtf8("verticalLayout_12"));
verticalLayout_2 = new QVBoxLayout(centralWidget);
verticalLayout_2->setSpacing(6);
verticalLayout_2->setContentsMargins(11, 11, 11, 11);
verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2"));
mainTab = new QTabWidget(centralWidget);
mainTab->setObjectName(QString::fromUtf8("mainTab"));
mainTab->setTabPosition(QTabWidget::North);
@ -272,98 +260,31 @@ public:
horizontalLayout_2->setSpacing(6);
horizontalLayout_2->setContentsMargins(11, 11, 11, 11);
horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2"));
verticalLayout_3 = new QVBoxLayout();
verticalLayout_3->setSpacing(6);
verticalLayout_3->setObjectName(QString::fromUtf8("verticalLayout_3"));
label = new QLabel(inputTab);
label->setObjectName(QString::fromUtf8("label"));
verticalLayout_3->addWidget(label);
horizontalLayout = new QHBoxLayout();
horizontalLayout->setSpacing(6);
horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
riles = new QTreeView(inputTab);
riles->setObjectName(QString::fromUtf8("riles"));
horizontalLayout->addWidget(riles);
verticalLayout = new QVBoxLayout();
verticalLayout->setSpacing(6);
verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
addFile = new QPushButton(inputTab);
addFile->setObjectName(QString::fromUtf8("addFile"));
label = new QLabel(inputTab);
label->setObjectName(QString::fromUtf8("label"));
verticalLayout->addWidget(addFile);
verticalLayout->addWidget(label);
appendFile = new QPushButton(inputTab);
appendFile->setObjectName(QString::fromUtf8("appendFile"));
files = new QTreeView(inputTab);
files->setObjectName(QString::fromUtf8("files"));
verticalLayout->addWidget(appendFile);
removeFile = new QPushButton(inputTab);
removeFile->setObjectName(QString::fromUtf8("removeFile"));
verticalLayout->addWidget(removeFile);
removeAll = new QPushButton(inputTab);
removeAll->setObjectName(QString::fromUtf8("removeAll"));
verticalLayout->addWidget(removeAll);
multipleFileParts = new QPushButton(inputTab);
multipleFileParts->setObjectName(QString::fromUtf8("multipleFileParts"));
verticalLayout->addWidget(multipleFileParts);
verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
verticalLayout->addItem(verticalSpacer);
horizontalLayout->addLayout(verticalLayout);
verticalLayout_3->addLayout(horizontalLayout);
verticalLayout->addWidget(files);
label_2 = new QLabel(inputTab);
label_2->setObjectName(QString::fromUtf8("label_2"));
verticalLayout_3->addWidget(label_2);
verticalLayout->addWidget(label_2);
horizontalLayout_3 = new QHBoxLayout();
horizontalLayout_3->setSpacing(6);
horizontalLayout_3->setObjectName(QString::fromUtf8("horizontalLayout_3"));
tracks = new QTreeView(inputTab);
tracks->setObjectName(QString::fromUtf8("tracks"));
horizontalLayout_3->addWidget(tracks);
verticalLayout_2 = new QVBoxLayout();
verticalLayout_2->setSpacing(6);
verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2"));
trackUp = new QPushButton(inputTab);
trackUp->setObjectName(QString::fromUtf8("trackUp"));
verticalLayout_2->addWidget(trackUp);
trackDown = new QPushButton(inputTab);
trackDown->setObjectName(QString::fromUtf8("trackDown"));
verticalLayout_2->addWidget(trackDown);
verticalSpacer_2 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
verticalLayout_2->addItem(verticalSpacer_2);
verticalLayout->addWidget(tracks);
horizontalLayout_3->addLayout(verticalLayout_2);
verticalLayout_3->addLayout(horizontalLayout_3);
horizontalLayout_2->addLayout(verticalLayout_3);
horizontalLayout_2->addLayout(verticalLayout);
verticalLayout_4 = new QVBoxLayout();
verticalLayout_4->setSpacing(6);
@ -380,7 +301,7 @@ public:
scrollArea->setWidgetResizable(true);
scrollAreaWidgetContents = new QWidget();
scrollAreaWidgetContents->setObjectName(QString::fromUtf8("scrollAreaWidgetContents"));
scrollAreaWidgetContents->setGeometry(QRect(0, 0, 388, 757));
scrollAreaWidgetContents->setGeometry(QRect(0, -366, 402, 757));
verticalLayout_9 = new QVBoxLayout(scrollAreaWidgetContents);
verticalLayout_9->setSpacing(6);
verticalLayout_9->setContentsMargins(11, 11, 11, 11);
@ -1080,41 +1001,46 @@ public:
mainTab->addTab(attachmentsTab, QString());
verticalLayout_12->addWidget(mainTab);
verticalLayout_2->addWidget(mainTab);
horizontalLayout_5 = new QHBoxLayout();
horizontalLayout_5->setSpacing(6);
horizontalLayout_5->setObjectName(QString::fromUtf8("horizontalLayout_5"));
horizontalLayout = new QHBoxLayout();
horizontalLayout->setSpacing(6);
horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
horizontalLayout_5->addItem(horizontalSpacer_2);
horizontalLayout->addItem(horizontalSpacer_2);
pbStartMuxing = new QPushButton(centralWidget);
pbStartMuxing->setObjectName(QString::fromUtf8("pbStartMuxing"));
addFiles = new QPushButton(centralWidget);
addFiles->setObjectName(QString::fromUtf8("addFiles"));
horizontalLayout_5->addWidget(pbStartMuxing);
horizontalLayout->addWidget(addFiles);
pbAddToJobQueue = new QPushButton(centralWidget);
pbAddToJobQueue->setObjectName(QString::fromUtf8("pbAddToJobQueue"));
startMuxing = new QPushButton(centralWidget);
startMuxing->setObjectName(QString::fromUtf8("startMuxing"));
horizontalLayout_5->addWidget(pbAddToJobQueue);
horizontalLayout->addWidget(startMuxing);
pbSaveSettings = new QPushButton(centralWidget);
pbSaveSettings->setObjectName(QString::fromUtf8("pbSaveSettings"));
addToJobQueue = new QPushButton(centralWidget);
addToJobQueue->setObjectName(QString::fromUtf8("addToJobQueue"));
horizontalLayout_5->addWidget(pbSaveSettings);
horizontalLayout->addWidget(addToJobQueue);
saveSettings = new QPushButton(centralWidget);
saveSettings->setObjectName(QString::fromUtf8("saveSettings"));
horizontalLayout->addWidget(saveSettings);
horizontalSpacer_3 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
horizontalLayout_5->addItem(horizontalSpacer_3);
horizontalLayout->addItem(horizontalSpacer_3);
verticalLayout_12->addLayout(horizontalLayout_5);
verticalLayout_2->addLayout(horizontalLayout);
MainWindow->setCentralWidget(centralWidget);
menuBar = new QMenuBar(MainWindow);
menuBar->setObjectName(QString::fromUtf8("menuBar"));
menuBar->setGeometry(QRect(0, 0, 846, 24));
menuBar->setGeometry(QRect(0, 0, 780, 24));
menuFile = new QMenu(menuBar);
menuFile->setObjectName(QString::fromUtf8("menuFile"));
menuMuxing = new QMenu(menuBar);
@ -1125,6 +1051,100 @@ public:
statusBar = new QStatusBar(MainWindow);
statusBar->setObjectName(QString::fromUtf8("statusBar"));
MainWindow->setStatusBar(statusBar);
#ifndef QT_NO_SHORTCUT
label->setBuddy(files);
label_2->setBuddy(tracks);
label_16->setBuddy(trackName);
label_17->setBuddy(trackLanguage);
label_18->setBuddy(defaultTrackFlag);
label_19->setBuddy(forcedTrackFlag);
label_31->setBuddy(compression);
label_20->setBuddy(trackTacks);
label_22->setBuddy(delay);
label_23->setBuddy(stretchBy);
label_24->setBuddy(defaultDuration);
label_21->setBuddy(timecodes);
label_26->setBuddy(stereoscopy);
label_27->setBuddy(cropping);
label_28->setBuddy(subtitleCharacterSet);
label_29->setBuddy(cues);
label_30->setBuddy(userDefinedTrackOptions);
label_5->setBuddy(title);
label_4->setBuddy(output);
label_6->setBuddy(globalTags);
label_7->setBuddy(segmentinfo);
label_34->setBuddy(splitMaxFiles);
label_9->setBuddy(segmentUIDs);
label_10->setBuddy(previousSegmentUID);
label_11->setBuddy(nextSegmentUID);
label_12->setBuddy(chapters);
label_13->setBuddy(chapterLanguage);
label_14->setBuddy(chapterCharacterSet);
label_15->setBuddy(cueNameFormat);
label_33->setBuddy(userDefinedOptions);
#endif // QT_NO_SHORTCUT
QWidget::setTabOrder(mainTab, files);
QWidget::setTabOrder(files, tracks);
QWidget::setTabOrder(tracks, scrollArea);
QWidget::setTabOrder(scrollArea, trackName);
QWidget::setTabOrder(trackName, trackLanguage);
QWidget::setTabOrder(trackLanguage, defaultTrackFlag);
QWidget::setTabOrder(defaultTrackFlag, forcedTrackFlag);
QWidget::setTabOrder(forcedTrackFlag, compression);
QWidget::setTabOrder(compression, trackTacks);
QWidget::setTabOrder(trackTacks, browseTrackTags);
QWidget::setTabOrder(browseTrackTags, delay);
QWidget::setTabOrder(delay, stretchBy);
QWidget::setTabOrder(stretchBy, defaultDuration);
QWidget::setTabOrder(defaultDuration, timecodes);
QWidget::setTabOrder(timecodes, browseTimecodes);
QWidget::setTabOrder(browseTimecodes, setAspectRatio);
QWidget::setTabOrder(setAspectRatio, aspectRatio);
QWidget::setTabOrder(aspectRatio, setDisplayWidthHeight);
QWidget::setTabOrder(setDisplayWidthHeight, displayWidth);
QWidget::setTabOrder(displayWidth, displayHeight);
QWidget::setTabOrder(displayHeight, stereoscopy);
QWidget::setTabOrder(stereoscopy, cropping);
QWidget::setTabOrder(cropping, aacIsSBR);
QWidget::setTabOrder(aacIsSBR, subtitleCharacterSet);
QWidget::setTabOrder(subtitleCharacterSet, cues);
QWidget::setTabOrder(cues, userDefinedTrackOptions);
QWidget::setTabOrder(userDefinedTrackOptions, title);
QWidget::setTabOrder(title, output);
QWidget::setTabOrder(output, browseOutput);
QWidget::setTabOrder(browseOutput, globalTags);
QWidget::setTabOrder(globalTags, browseGlobalTags);
QWidget::setTabOrder(browseGlobalTags, segmentinfo);
QWidget::setTabOrder(segmentinfo, browseSegmentInfo);
QWidget::setTabOrder(browseSegmentInfo, doNotSplit);
QWidget::setTabOrder(doNotSplit, doSplitAfterSize);
QWidget::setTabOrder(doSplitAfterSize, splitSize);
QWidget::setTabOrder(splitSize, doSplitAfterDuration);
QWidget::setTabOrder(doSplitAfterDuration, splitDuration);
QWidget::setTabOrder(splitDuration, doSplitAfterTimecodes);
QWidget::setTabOrder(doSplitAfterTimecodes, splitTimecodes);
QWidget::setTabOrder(splitTimecodes, doSplitByParts);
QWidget::setTabOrder(doSplitByParts, splitParts);
QWidget::setTabOrder(splitParts, splitMaxFiles);
QWidget::setTabOrder(splitMaxFiles, linkFiles);
QWidget::setTabOrder(linkFiles, segmentUIDs);
QWidget::setTabOrder(segmentUIDs, previousSegmentUID);
QWidget::setTabOrder(previousSegmentUID, nextSegmentUID);
QWidget::setTabOrder(nextSegmentUID, chapters);
QWidget::setTabOrder(chapters, browseChapters);
QWidget::setTabOrder(browseChapters, chapterLanguage);
QWidget::setTabOrder(chapterLanguage, chapterCharacterSet);
QWidget::setTabOrder(chapterCharacterSet, cueNameFormat);
QWidget::setTabOrder(cueNameFormat, webmMode);
QWidget::setTabOrder(webmMode, userDefinedOptions);
QWidget::setTabOrder(userDefinedOptions, editUserDefinedOptions);
QWidget::setTabOrder(editUserDefinedOptions, attachments);
QWidget::setTabOrder(attachments, addAttachment);
QWidget::setTabOrder(addAttachment, removeAttachment);
QWidget::setTabOrder(removeAttachment, addFiles);
QWidget::setTabOrder(addFiles, startMuxing);
QWidget::setTabOrder(startMuxing, addToJobQueue);
QWidget::setTabOrder(addToJobQueue, saveSettings);
menuBar->addAction(menuFile->menuAction());
menuBar->addAction(menuMuxing->menuAction());
@ -1149,9 +1169,12 @@ public:
menuTools->addAction(action_Options);
retranslateUi(MainWindow);
QObject::connect(pbStartMuxing, SIGNAL(clicked()), MainWindow, SLOT(startMuxingPressed()));
QObject::connect(pbAddToJobQueue, SIGNAL(clicked()), MainWindow, SLOT(onAddToJobQueue()));
QObject::connect(pbSaveSettings, SIGNAL(clicked()), MainWindow, SLOT(onSaveSettings()));
QObject::connect(startMuxing, SIGNAL(clicked()), MainWindow, SLOT(onStartMuxing()));
QObject::connect(addToJobQueue, SIGNAL(clicked()), MainWindow, SLOT(onAddToJobQueue()));
QObject::connect(saveSettings, SIGNAL(clicked()), MainWindow, SLOT(onSaveSettings()));
QObject::connect(addFiles, SIGNAL(clicked()), MainWindow, SLOT(onAddFiles()));
QObject::connect(actionAdd_to_job_queue, SIGNAL(triggered()), MainWindow, SLOT(onAddToJobQueue()));
QObject::connect(actionExit, SIGNAL(triggered()), MainWindow, SLOT(close()));
mainTab->setCurrentIndex(0);
@ -1177,14 +1200,7 @@ public:
action_Chapter_editor->setText(QApplication::translate("MainWindow", "&Chapter editor", 0, QApplication::UnicodeUTF8));
action_Options->setText(QApplication::translate("MainWindow", "&Options...", 0, QApplication::UnicodeUTF8));
label->setText(QApplication::translate("MainWindow", "Files:", 0, QApplication::UnicodeUTF8));
addFile->setText(QApplication::translate("MainWindow", "Add", 0, QApplication::UnicodeUTF8));
appendFile->setText(QApplication::translate("MainWindow", "Append", 0, QApplication::UnicodeUTF8));
removeFile->setText(QApplication::translate("MainWindow", "Remove", 0, QApplication::UnicodeUTF8));
removeAll->setText(QApplication::translate("MainWindow", "Remove all", 0, QApplication::UnicodeUTF8));
multipleFileParts->setText(QApplication::translate("MainWindow", "Multiple Parts", 0, QApplication::UnicodeUTF8));
label_2->setText(QApplication::translate("MainWindow", "Tracks, chapters, tags and attachments:", 0, QApplication::UnicodeUTF8));
trackUp->setText(QApplication::translate("MainWindow", "up", 0, QApplication::UnicodeUTF8));
trackDown->setText(QApplication::translate("MainWindow", "down", 0, QApplication::UnicodeUTF8));
label_3->setText(QApplication::translate("MainWindow", "Properties:", 0, QApplication::UnicodeUTF8));
groupBox_7->setTitle(QApplication::translate("MainWindow", "General options", 0, QApplication::UnicodeUTF8));
label_16->setText(QApplication::translate("MainWindow", "Track name:", 0, QApplication::UnicodeUTF8));
@ -1271,12 +1287,13 @@ public:
addAttachment->setText(QApplication::translate("MainWindow", "Add", 0, QApplication::UnicodeUTF8));
removeAttachment->setText(QApplication::translate("MainWindow", "Remove", 0, QApplication::UnicodeUTF8));
mainTab->setTabText(mainTab->indexOf(attachmentsTab), QApplication::translate("MainWindow", "Attachments", 0, QApplication::UnicodeUTF8));
pbStartMuxing->setText(QApplication::translate("MainWindow", "Start muxing", 0, QApplication::UnicodeUTF8));
pbAddToJobQueue->setText(QApplication::translate("MainWindow", "Add to job queue", 0, QApplication::UnicodeUTF8));
pbSaveSettings->setText(QApplication::translate("MainWindow", "Save settings", 0, QApplication::UnicodeUTF8));
menuFile->setTitle(QApplication::translate("MainWindow", "File", 0, QApplication::UnicodeUTF8));
menuMuxing->setTitle(QApplication::translate("MainWindow", "Muxing", 0, QApplication::UnicodeUTF8));
menuTools->setTitle(QApplication::translate("MainWindow", "Tools", 0, QApplication::UnicodeUTF8));
addFiles->setText(QApplication::translate("MainWindow", "&Add files", 0, QApplication::UnicodeUTF8));
startMuxing->setText(QApplication::translate("MainWindow", "Sta&rt muxing", 0, QApplication::UnicodeUTF8));
addToJobQueue->setText(QApplication::translate("MainWindow", "Add to job &queue", 0, QApplication::UnicodeUTF8));
saveSettings->setText(QApplication::translate("MainWindow", "&Save settings", 0, QApplication::UnicodeUTF8));
menuFile->setTitle(QApplication::translate("MainWindow", "&File", 0, QApplication::UnicodeUTF8));
menuMuxing->setTitle(QApplication::translate("MainWindow", "&Muxing", 0, QApplication::UnicodeUTF8));
menuTools->setTitle(QApplication::translate("MainWindow", "&Tools", 0, QApplication::UnicodeUTF8));
} // retranslateUi
};

View File

@ -6,15 +6,15 @@
<rect>
<x>0</x>
<y>0</y>
<width>846</width>
<height>571</height>
<width>780</width>
<height>556</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QVBoxLayout" name="verticalLayout_12">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QTabWidget" name="mainTab">
<property name="tabPosition">
@ -29,117 +29,32 @@
</attribute>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Files:</string>
</property>
<property name="buddy">
<cstring>files</cstring>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QTreeView" name="riles"/>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QPushButton" name="addFile">
<property name="text">
<string>Add</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="appendFile">
<property name="text">
<string>Append</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="removeFile">
<property name="text">
<string>Remove</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="removeAll">
<property name="text">
<string>Remove all</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="multipleFileParts">
<property name="text">
<string>Multiple Parts</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<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>
</item>
</layout>
<widget class="QTreeView" name="files"/>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Tracks, chapters, tags and attachments:</string>
</property>
<property name="buddy">
<cstring>tracks</cstring>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QTreeView" name="tracks"/>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QPushButton" name="trackUp">
<property name="text">
<string>up</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="trackDown">
<property name="text">
<string>down</string>
</property>
</widget>
</item>
<item>
<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>
</item>
</layout>
<widget class="QTreeView" name="tracks"/>
</item>
</layout>
</item>
@ -167,8 +82,8 @@
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>388</width>
<y>-366</y>
<width>402</width>
<height>757</height>
</rect>
</property>
@ -184,6 +99,9 @@
<property name="text">
<string>Track name:</string>
</property>
<property name="buddy">
<cstring>trackName</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
@ -194,6 +112,9 @@
<property name="text">
<string>Language:</string>
</property>
<property name="buddy">
<cstring>trackLanguage</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
@ -204,6 +125,9 @@
<property name="text">
<string>&quot;Default track&quot; flag:</string>
</property>
<property name="buddy">
<cstring>defaultTrackFlag</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
@ -230,6 +154,9 @@
<property name="text">
<string>&quot;Forced track&quot; flag:</string>
</property>
<property name="buddy">
<cstring>forcedTrackFlag</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
@ -251,6 +178,9 @@
<property name="text">
<string>Compression:</string>
</property>
<property name="buddy">
<cstring>compression</cstring>
</property>
</widget>
</item>
<item row="4" column="1">
@ -277,6 +207,9 @@
<property name="text">
<string>Tags:</string>
</property>
<property name="buddy">
<cstring>trackTacks</cstring>
</property>
</widget>
</item>
<item row="5" column="1">
@ -307,6 +240,9 @@
<property name="text">
<string>Delay (in ms):</string>
</property>
<property name="buddy">
<cstring>delay</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
@ -317,6 +253,9 @@
<property name="text">
<string>Stretch by:</string>
</property>
<property name="buddy">
<cstring>stretchBy</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
@ -327,6 +266,9 @@
<property name="text">
<string>Default duration/FPS:</string>
</property>
<property name="buddy">
<cstring>defaultDuration</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
@ -401,6 +343,9 @@
<property name="text">
<string>Timecode file:</string>
</property>
<property name="buddy">
<cstring>timecodes</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
@ -504,6 +449,9 @@
<property name="text">
<string>Stereoscopy:</string>
</property>
<property name="buddy">
<cstring>stereoscopy</cstring>
</property>
</widget>
</item>
<item row="2" column="1" rowspan="2">
@ -514,6 +462,9 @@
<property name="text">
<string>Cropping:</string>
</property>
<property name="buddy">
<cstring>cropping</cstring>
</property>
</widget>
</item>
<item row="4" column="1">
@ -555,6 +506,9 @@
<property name="text">
<string>Character set:</string>
</property>
<property name="buddy">
<cstring>subtitleCharacterSet</cstring>
</property>
</widget>
</item>
<item>
@ -581,6 +535,9 @@
<property name="text">
<string>Indexing (cues):</string>
</property>
<property name="buddy">
<cstring>cues</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
@ -612,6 +569,9 @@
<property name="text">
<string>User defined options:</string>
</property>
<property name="buddy">
<cstring>userDefinedTrackOptions</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
@ -659,6 +619,9 @@
<property name="text">
<string>File title:</string>
</property>
<property name="buddy">
<cstring>title</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
@ -669,6 +632,9 @@
<property name="text">
<string>Destination:</string>
</property>
<property name="buddy">
<cstring>output</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
@ -690,6 +656,9 @@
<property name="text">
<string>Global tags:</string>
</property>
<property name="buddy">
<cstring>globalTags</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
@ -711,6 +680,9 @@
<property name="text">
<string>Segment info:</string>
</property>
<property name="buddy">
<cstring>segmentinfo</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
@ -858,6 +830,9 @@
<property name="text">
<string>Maximum number of files:</string>
</property>
<property name="buddy">
<cstring>splitMaxFiles</cstring>
</property>
</widget>
</item>
<item row="6" column="1">
@ -901,6 +876,9 @@
<property name="text">
<string>Segment UIDs:</string>
</property>
<property name="buddy">
<cstring>segmentUIDs</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
@ -911,6 +889,9 @@
<property name="text">
<string>Previous segment UID:</string>
</property>
<property name="buddy">
<cstring>previousSegmentUID</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
@ -921,6 +902,9 @@
<property name="text">
<string>Next segment UID:</string>
</property>
<property name="buddy">
<cstring>nextSegmentUID</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
@ -940,6 +924,9 @@
<property name="text">
<string>Chapter file:</string>
</property>
<property name="buddy">
<cstring>chapters</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
@ -961,6 +948,9 @@
<property name="text">
<string>Language:</string>
</property>
<property name="buddy">
<cstring>chapterLanguage</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
@ -971,6 +961,9 @@
<property name="text">
<string>Character set:</string>
</property>
<property name="buddy">
<cstring>chapterCharacterSet</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
@ -981,6 +974,9 @@
<property name="text">
<string>Cue name format:</string>
</property>
<property name="buddy">
<cstring>cueNameFormat</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
@ -1009,6 +1005,9 @@
<property name="text">
<string>User-defined options:</string>
</property>
<property name="buddy">
<cstring>userDefinedOptions</cstring>
</property>
</widget>
</item>
<item>
@ -1098,7 +1097,7 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
@ -1113,23 +1112,30 @@
</spacer>
</item>
<item>
<widget class="QPushButton" name="pbStartMuxing">
<widget class="QPushButton" name="addFiles">
<property name="text">
<string>Start muxing</string>
<string>&amp;Add files</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pbAddToJobQueue">
<widget class="QPushButton" name="startMuxing">
<property name="text">
<string>Add to job queue</string>
<string>Sta&amp;rt muxing</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pbSaveSettings">
<widget class="QPushButton" name="addToJobQueue">
<property name="text">
<string>Save settings</string>
<string>Add to job &amp;queue</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="saveSettings">
<property name="text">
<string>&amp;Save settings</string>
</property>
</widget>
</item>
@ -1155,13 +1161,13 @@
<rect>
<x>0</x>
<y>0</y>
<width>846</width>
<width>780</width>
<height>24</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
<property name="title">
<string>File</string>
<string>&amp;File</string>
</property>
<addaction name="actionNew"/>
<addaction name="actionOpen_job_file"/>
@ -1173,7 +1179,7 @@
</widget>
<widget class="QMenu" name="menuMuxing">
<property name="title">
<string>Muxing</string>
<string>&amp;Muxing</string>
</property>
<addaction name="action_Start_muxing"/>
<addaction name="separator"/>
@ -1185,7 +1191,7 @@
</widget>
<widget class="QMenu" name="menuTools">
<property name="title">
<string>Tools</string>
<string>&amp;Tools</string>
</property>
<addaction name="action_Header_editor"/>
<addaction name="action_Chapter_editor"/>
@ -1269,17 +1275,82 @@
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<tabstops>
<tabstop>mainTab</tabstop>
<tabstop>files</tabstop>
<tabstop>tracks</tabstop>
<tabstop>scrollArea</tabstop>
<tabstop>trackName</tabstop>
<tabstop>trackLanguage</tabstop>
<tabstop>defaultTrackFlag</tabstop>
<tabstop>forcedTrackFlag</tabstop>
<tabstop>compression</tabstop>
<tabstop>trackTacks</tabstop>
<tabstop>browseTrackTags</tabstop>
<tabstop>delay</tabstop>
<tabstop>stretchBy</tabstop>
<tabstop>defaultDuration</tabstop>
<tabstop>timecodes</tabstop>
<tabstop>browseTimecodes</tabstop>
<tabstop>setAspectRatio</tabstop>
<tabstop>aspectRatio</tabstop>
<tabstop>setDisplayWidthHeight</tabstop>
<tabstop>displayWidth</tabstop>
<tabstop>displayHeight</tabstop>
<tabstop>stereoscopy</tabstop>
<tabstop>cropping</tabstop>
<tabstop>aacIsSBR</tabstop>
<tabstop>subtitleCharacterSet</tabstop>
<tabstop>cues</tabstop>
<tabstop>userDefinedTrackOptions</tabstop>
<tabstop>title</tabstop>
<tabstop>output</tabstop>
<tabstop>browseOutput</tabstop>
<tabstop>globalTags</tabstop>
<tabstop>browseGlobalTags</tabstop>
<tabstop>segmentinfo</tabstop>
<tabstop>browseSegmentInfo</tabstop>
<tabstop>doNotSplit</tabstop>
<tabstop>doSplitAfterSize</tabstop>
<tabstop>splitSize</tabstop>
<tabstop>doSplitAfterDuration</tabstop>
<tabstop>splitDuration</tabstop>
<tabstop>doSplitAfterTimecodes</tabstop>
<tabstop>splitTimecodes</tabstop>
<tabstop>doSplitByParts</tabstop>
<tabstop>splitParts</tabstop>
<tabstop>splitMaxFiles</tabstop>
<tabstop>linkFiles</tabstop>
<tabstop>segmentUIDs</tabstop>
<tabstop>previousSegmentUID</tabstop>
<tabstop>nextSegmentUID</tabstop>
<tabstop>chapters</tabstop>
<tabstop>browseChapters</tabstop>
<tabstop>chapterLanguage</tabstop>
<tabstop>chapterCharacterSet</tabstop>
<tabstop>cueNameFormat</tabstop>
<tabstop>webmMode</tabstop>
<tabstop>userDefinedOptions</tabstop>
<tabstop>editUserDefinedOptions</tabstop>
<tabstop>attachments</tabstop>
<tabstop>addAttachment</tabstop>
<tabstop>removeAttachment</tabstop>
<tabstop>addFiles</tabstop>
<tabstop>startMuxing</tabstop>
<tabstop>addToJobQueue</tabstop>
<tabstop>saveSettings</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>pbStartMuxing</sender>
<sender>startMuxing</sender>
<signal>clicked()</signal>
<receiver>MainWindow</receiver>
<slot>startMuxingPressed()</slot>
<slot>onStartMuxing()</slot>
<hints>
<hint type="sourcelabel">
<x>320</x>
<y>527</y>
<x>374</x>
<y>526</y>
</hint>
<hint type="destinationlabel">
<x>224</x>
@ -1288,7 +1359,7 @@
</hints>
</connection>
<connection>
<sender>pbAddToJobQueue</sender>
<sender>addToJobQueue</sender>
<signal>clicked()</signal>
<receiver>MainWindow</receiver>
<slot>onAddToJobQueue()</slot>
@ -1304,7 +1375,7 @@
</hints>
</connection>
<connection>
<sender>pbSaveSettings</sender>
<sender>saveSettings</sender>
<signal>clicked()</signal>
<receiver>MainWindow</receiver>
<slot>onSaveSettings()</slot>
@ -1319,10 +1390,59 @@
</hint>
</hints>
</connection>
<connection>
<sender>addFiles</sender>
<signal>clicked()</signal>
<receiver>MainWindow</receiver>
<slot>onAddFiles()</slot>
<hints>
<hint type="sourcelabel">
<x>251</x>
<y>505</y>
</hint>
<hint type="destinationlabel">
<x>141</x>
<y>507</y>
</hint>
</hints>
</connection>
<connection>
<sender>actionAdd_to_job_queue</sender>
<signal>triggered()</signal>
<receiver>MainWindow</receiver>
<slot>onAddToJobQueue()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>389</x>
<y>277</y>
</hint>
</hints>
</connection>
<connection>
<sender>actionExit</sender>
<signal>triggered()</signal>
<receiver>MainWindow</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>389</x>
<y>277</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>onStartMuxing()</slot>
<slot>onAddToJobQueue()</slot>
<slot>onSaveSettings()</slot>
<slot>onAddFiles()</slot>
</slots>
</ui>

View File

@ -1,7 +1,13 @@
#include "common/common_pch.h"
#include "common/qt.h"
#include "mmg-qt/main_window.h"
#include "mmg-qt/forms/main_window.h"
#include "mmg-qt/util/file_identifier.h"
#include "mmg-qt/util/file_type_filter.h"
#include "mmg-qt/util/settings.h"
#include <QFileDialog>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow{parent}
@ -13,3 +19,38 @@ MainWindow::MainWindow(QWidget *parent)
MainWindow::~MainWindow() {
delete ui;
}
void
MainWindow::onAddFiles() {
auto fileNames = selectFilesToAdd();
if (fileNames.empty())
return;
for (auto &fileName : fileNames)
addFile(fileName, false);
}
QStringList
MainWindow::selectFilesToAdd() {
QFileDialog dlg{this};
dlg.setNameFilters(FileTypeFilter::get());
dlg.setFileMode(QFileDialog::ExistingFiles);
dlg.setDirectory(Settings::get().m_lastOpenDir);
dlg.setWindowTitle(QY("Add media files"));
if (!dlg.exec())
return QStringList{};
Settings::get().m_lastOpenDir = dlg.directory();
return dlg.selectedFiles();
}
void
MainWindow::addFile(QString const &fileName,
bool /*append*/) {
FileIdentifier identifier{ this, fileName };
if (!identifier.identify())
return;
}

View File

@ -1,6 +1,9 @@
#ifndef MTX_MMGQT_MAIN_WINDOW_H
#define MTX_MMGQT_MAIN_WINDOW_H
#include "common/common_pch.h"
#include <QDir>
#include <QMainWindow>
namespace Ui {
@ -11,11 +14,18 @@ class MainWindow : public QMainWindow {
Q_OBJECT;
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
public slots:
virtual void onAddFiles();
protected:
virtual QStringList selectFilesToAdd();
virtual void addFile(QString const &fileName, bool append);
private:
Ui::MainWindow *ui;
Ui::MainWindow *ui;
};
#endif // MTX_MMGQT_MAIN_WINDOW_H

View File

@ -5,12 +5,6 @@
#include "mmg-qt/mmg_qt.h"
#include "mmg-qt/main_window.h"
mkvmerge_settings_t::mkvmerge_settings_t()
: executable(Q("mkvmerge"))
, priority(priority_normal)
{
}
int
main(int argc,
char **argv) {

View File

@ -7,19 +7,4 @@
#include "common/qt.h"
struct mkvmerge_settings_t {
enum process_priority_e {
priority_lowest,
priority_low,
priority_normal,
priority_high,
priority_highest,
};
QString executable;
process_priority_e priority;
mkvmerge_settings_t();
};
#endif // MTX_MMGQT_MMG_QT_H

View File

@ -0,0 +1,74 @@
#include "common/common_pch.h"
#include "common/qt.h"
#include "mmg-qt/util/file_identifier.h"
#include "mmg-qt/util/process.h"
#include "mmg-qt/util/settings.h"
#include <QMessageBox>
#include <QStringList>
FileIdentifier::FileIdentifier(QWidget *parent,
QString const &fileName)
: m_parent(parent)
, m_exitCode(0)
, m_fileName(fileName)
{
}
FileIdentifier::~FileIdentifier() {
}
bool
FileIdentifier::identify() {
if (m_fileName.isEmpty())
return false;
QStringList args;
args << "--output-charset" << "utf-8" << "--identify-for-mmg" << m_fileName;
auto process = Process::execute(Settings::get().m_mkvmergeExe, args);
auto exitCode = process->process().exitCode();
m_output = process->output();
mxinfo(boost::format("oh yeah, code %2%: %1%\n") % to_utf8(m_output.join(":::")) % exitCode);
if (0 == exitCode)
return true;
if (3 == exitCode) {
auto pos = m_output.isEmpty() ? -1 : m_output[0].indexOf("container:");
auto container = -1 == pos ? QY("unknown") : m_output[0].mid(pos + 11);
QMessageBox::critical(m_parent, QY("Unsupported file format"), QY("The file is an unsupported container format (%1).").arg(container));
return false;
}
QMessageBox::critical(m_parent, QY("Unrecognized file format"), QY("The file was not recognized as a supported format (exit code: %1).").arg(exitCode));
return false;
}
QString const &
FileIdentifier::fileName()
const {
return m_fileName;
}
void
FileIdentifier::setFileName(QString const &fileName) {
m_fileName = fileName;
}
int
FileIdentifier::exitCode()
const {
return m_exitCode;
}
QStringList const &
FileIdentifier::output()
const {
return m_output;
}

View File

@ -0,0 +1,31 @@
#ifndef MTX_MMGQT_FILE_IDENTIFIER_H
#define MTX_MMGQT_FILE_IDENTIFIER_H
#include "common/common_pch.h"
#include <QStringList>
#include <QWidget>
class FileIdentifier: public QObject {
Q_OBJECT;
private:
QWidget *m_parent;
int m_exitCode;
QStringList m_output;
QString m_fileName;
public:
FileIdentifier(QWidget *parent = nullptr, QString const &fileName = QString{});
virtual ~FileIdentifier();
virtual bool identify();
virtual QString const &fileName() const;
virtual void setFileName(QString const &fileName);
virtual int exitCode() const;
virtual QStringList const &output() const;
};
#endif // MTX_MMGQT_FILE_IDENTIFIER_H

View File

@ -0,0 +1,48 @@
#include "common/common_pch.h"
#include "common/file_types.h"
#include "common/qt.h"
#include "mmg-qt/util/file_type_filter.h"
#include <QStringList>
QStringList FileTypeFilter::s_filter;
QStringList const &
FileTypeFilter::get() {
if (!s_filter.isEmpty())
return s_filter;
auto &file_types = file_type_t::get_supported();
std::map<QString, bool> all_extensions_map;
for (auto &file_type : file_types) {
auto extensions = to_qs(file_type.extensions).split(" ");
QStringList extensions_full;
for (auto &extension : extensions) {
all_extensions_map[extension] = true;
extensions_full << QString{"*.%1"}.arg(extension);
#if !defined(SYS_WINDOWS)
auto extension_upper = extension.toUpper();
all_extensions_map[extension_upper] = true;
if (extension_upper != extension)
extensions_full << QString("*.%1").arg(extension_upper);
#endif // !SYS_WINDOWS
}
s_filter << QString("%1 (%2)").arg(to_qs(file_type.title)).arg(extensions_full.join(" "));
}
QStringList all_extensions;
for (auto &extension : all_extensions_map)
all_extensions << QString("*.%1").arg(extension.first);
std::sort(s_filter.begin(), s_filter.end());
s_filter.push_front(QY("All files (*)"));
s_filter.push_front(QY("All supported media files (%1)").arg(all_extensions.join(" ")));
return s_filter;
}

View File

@ -0,0 +1,16 @@
#ifndef MTX_MMGQT_FILE_TYPE_FILTER_H
#define MTX_MMGQT_FILE_TYPE_FILTER_H
#include "common/common_pch.h"
#include <QStringList>
class FileTypeFilter {
public:
static QStringList const & get();
public:
static QStringList s_filter;
};
#endif // MTX_MMGQT_FILE_TYPE_FILTER_H

View File

@ -11,7 +11,7 @@ Process::Process(QString const &command,
: m_command(command)
, m_args(args)
{
connect(&m_process, SIGNAL(readyReadStandardOutput()), this, SLOT(data_available()));
connect(&m_process, SIGNAL(readyReadStandardOutput()), this, SLOT(dataAvailable()));
}
Process::~Process() {

View File

@ -0,0 +1,24 @@
#include "common/common_pch.h"
#include "mmg-qt/util/settings.h"
Settings Settings::s_settings;
Settings::Settings()
: m_mkvmergeExe("mkvmerge")
, m_priority(priority_normal)
{
}
Settings &
Settings::get() {
return s_settings;
}
void
Settings::load() {
}
void
Settings::save() {
}

View File

@ -0,0 +1,36 @@
#ifndef MTX_MMGQT_SETTINGS_H
#define MTX_MMGQT_SETTINGS_H
#include "common/common_pch.h"
#include <QDir>
#include <QString>
class Settings: public QObject {
Q_OBJECT;
public:
enum process_priority_e {
priority_lowest,
priority_low,
priority_normal,
priority_high,
priority_highest,
};
QString m_mkvmergeExe;
process_priority_e m_priority;
QDir m_lastOpenDir;
public:
Settings();
void load();
void save();
public:
static Settings s_settings;
static Settings &get();
};
// extern Settings g_settings;
#endif // MTX_MMGQT_SETTINGS_H