misc improvements

This commit is contained in:
Martchus 2016-03-22 23:01:50 +01:00
parent 782e1a8557
commit 52e800c5c6
4 changed files with 34 additions and 10 deletions

View File

@ -73,7 +73,7 @@ Here are some Bash examples which illustrate getting and setting tag information
```
tageditor get title album artist --files /some/dir/*.m4a
```
* Displays technical information about all *.m4a files in the specified directory:
```
@ -87,7 +87,7 @@ Here are some Bash examples which illustrate getting and setting tag information
"album=The Album" "artist=The Artist" \
cover=/path/to/image track={1..16}/16 --files /some/dir/*.m4a
```
The first file will get the name *Title of 1st file*, the second file will get the name *Title of 2nd file* and so on.
The 16th and following files will all get the name *Title of the 16th file*. The same scheme is used for the track numbers.
All files will get the album name *The Album*, the artist *The Artist* and the cover image from the file */path/to/image*.
@ -108,7 +108,7 @@ Here are some Bash examples which illustrate getting and setting tag information
# now set the titles and other tag information
tageditor set "${titles[@]}" "album=Some Album" track+=1/25 disk=1/1 -f *.m4a
```
Note the *+* sign after the field name *track* which indicates that the field value should be increased after
a file has been processed.
@ -125,9 +125,10 @@ The following Qt 5 modules are requried: core gui qml/script widgets webenginewi
* When building with CMake the Qt modules can be selected explicitely by specifying -DWEBVIEW_PROVIDER=webkit/webengine and/or -DJS_PROVIDER=script/qml.
## TODO
- Support more tag formats (EXIF, PDF metadata, ...).
- Set tag information concurrently if multiple files have been specified (CLI).
- Support more formats (EXIF, PDF metadata, Theora, ...).
- Allow adding tags to specific streams when dealing with OGG.
- Do tests with Matroska files which have multiple segments.
- Set tag information concurrently if multiple files have been specified (CLI).
## Bugs
- Large file information is not shown when using Qt WebEngine.

View File

@ -2,12 +2,20 @@
<ui version="4.0">
<class>QtGui::EditorTempOptionPage</class>
<widget class="QWidget" name="QtGui::EditorTempOptionPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>206</width>
<height>110</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<widget class="QLabel" name="instructionLabel">
<property name="text">
<string>Directory to store temporary/backup files</string>
</property>
@ -31,6 +39,9 @@
</item>
</layout>
</item>
<item>
<widget class="NotificationLabel" name="notificationLabel" native="true"/>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
@ -52,6 +63,12 @@
<extends>QLineEdit</extends>
<header>gui/pathlineedit.h</header>
</customwidget>
<customwidget>
<class>NotificationLabel</class>
<extends>QWidget</extends>
<header>gui/notificationlabel.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>

View File

@ -144,6 +144,8 @@ QWidget *EditorTempOptionPage::setupWidget()
{
auto *widget = UiFileBasedOptionPage<Ui::EditorTempOptionPage>::setupWidget();
QObject::connect(ui()->selectPushButton, &QPushButton::clicked, std::bind(&EditorTempOptionPage::showDirectorySelection, this));
ui()->notificationLabel->setText(QApplication::tr("Currently this directory must be on the same partition as the files you want to edit."));
ui()->notificationLabel->setNotificationType(NotificationType::Information);
return widget;
}

View File

@ -19,6 +19,7 @@
#include <tagparser/mp4/mp4container.h>
#include <tagparser/mp4/mp4tag.h>
#include <tagparser/matroska/matroskatag.h>
#include <tagparser/vorbis/vorbiscomment.h>
#include <qtutilities/misc/dialogutils.h>
#include <qtutilities/misc/trylocker.h>
@ -482,7 +483,7 @@ void TagEditorWidget::updateTagManagementMenu()
label = tr("MP4/iTunes tag");
break;
case ContainerFormat::Ogg:
label = tr("Vorbis comment");
label = tr("Vorbis/Opus comment");
break;
default:
label = tr("Tag");
@ -507,9 +508,12 @@ void TagEditorWidget::updateTagManagementMenu()
}
// add "Remove tag" and "Change target" actions
for(Tag *tag : m_tags) {
connect(m_removeTagMenu->addAction(QString::fromLocal8Bit(tag->toString().c_str())), &QAction::triggered, std::bind(&TagEditorWidget::removeTag, this, tag));
if(tag->supportsTarget()) {
connect(m_changeTargetMenu->addAction(QString::fromLocal8Bit(tag->toString().c_str())), &QAction::triggered, std::bind(&TagEditorWidget::changeTarget, this, tag));
// check whether the tag is not from a Vorbis stream because in this case removing the tag seems to cause problems and hence shouldn't be proposed
if(tag->type() != TagType::VorbisComment || static_cast<VorbisComment *>(tag)->oggParams().streamFormat != GeneralMediaFormat::Vorbis) {
connect(m_removeTagMenu->addAction(QString::fromLocal8Bit(tag->toString().c_str())), &QAction::triggered, std::bind(&TagEditorWidget::removeTag, this, tag));
if(tag->supportsTarget()) {
connect(m_changeTargetMenu->addAction(QString::fromLocal8Bit(tag->toString().c_str())), &QAction::triggered, std::bind(&TagEditorWidget::changeTarget, this, tag));
}
}
}
}