mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-04 21:27:58 +02:00
Added more tag attributes from metadata editor.
This commit is contained in:
@@ -32,6 +32,7 @@
|
|||||||
|
|
||||||
#include "taglib/fileref.h"
|
#include "taglib/fileref.h"
|
||||||
#include "filemetadata/taghandlers/tag.h"
|
#include "filemetadata/taghandlers/tag.h"
|
||||||
|
#include "utils/TomahawkUtils.h"
|
||||||
|
|
||||||
MetadataEditor::MetadataEditor( Tomahawk::result_ptr result, QWidget *parent )
|
MetadataEditor::MetadataEditor( Tomahawk::result_ptr result, QWidget *parent )
|
||||||
: QDialog( parent )
|
: QDialog( parent )
|
||||||
@@ -46,8 +47,14 @@ MetadataEditor::MetadataEditor( Tomahawk::result_ptr result, QWidget *parent )
|
|||||||
setArtist( result->artist()->name() );
|
setArtist( result->artist()->name() );
|
||||||
setAlbum( result->album()->name() );
|
setAlbum( result->album()->name() );
|
||||||
setDiscNumber( result->albumpos() );
|
setDiscNumber( result->albumpos() );
|
||||||
|
setDuration( result->duration() );
|
||||||
|
setYear( result->year() );
|
||||||
setBitrate( result->bitrate() );
|
setBitrate( result->bitrate() );
|
||||||
|
|
||||||
|
QFileInfo fi( QUrl( m_result->url() ).toLocalFile() );
|
||||||
|
setFileName( fi.fileName() );
|
||||||
|
setFileSize( TomahawkUtils::filesizeToString( fi.size() ) );
|
||||||
|
|
||||||
connect( ui->buttonBox, SIGNAL( accepted() ), SLOT( writeMetadata() ) );
|
connect( ui->buttonBox, SIGNAL( accepted() ), SLOT( writeMetadata() ) );
|
||||||
connect( ui->buttonBox, SIGNAL( rejected() ), SLOT( close() ) );
|
connect( ui->buttonBox, SIGNAL( rejected() ), SLOT( close() ) );
|
||||||
}
|
}
|
||||||
@@ -119,8 +126,36 @@ MetadataEditor::setDiscNumber( unsigned int num )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
MetadataEditor::setDuration( unsigned int duration )
|
||||||
|
{
|
||||||
|
ui->durationLineEdit->setText( TomahawkUtils::timeToString( duration ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
MetadataEditor::setYear( int year )
|
||||||
|
{
|
||||||
|
ui->yearLineEdit->setText( QString( "%1" ).arg( year ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MetadataEditor::setBitrate( unsigned int bitrate )
|
MetadataEditor::setBitrate( unsigned int bitrate )
|
||||||
{
|
{
|
||||||
ui->bitrateLabel->setNum( (int) bitrate );
|
ui->bitrateLineEdit->setText( QString( "%1" ).arg( bitrate ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
MetadataEditor::setFileName( const QString& fn )
|
||||||
|
{
|
||||||
|
ui->fileNameLineEdit->setText( fn );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
MetadataEditor::setFileSize( const QString& size )
|
||||||
|
{
|
||||||
|
ui->fileSizeLineEdit->setText( size );
|
||||||
}
|
}
|
||||||
|
@@ -46,12 +46,19 @@ public:
|
|||||||
private slots:
|
private slots:
|
||||||
void writeMetadata();
|
void writeMetadata();
|
||||||
|
|
||||||
|
/* tag attributes */
|
||||||
void setTitle( const QString& title );
|
void setTitle( const QString& title );
|
||||||
void setArtist( const QString& artist );
|
void setArtist( const QString& artist );
|
||||||
void setAlbum( const QString& album );
|
void setAlbum( const QString& album );
|
||||||
void setDiscNumber( unsigned int num );
|
void setDiscNumber( unsigned int num );
|
||||||
|
void setDuration( unsigned int duration );
|
||||||
|
void setYear( int year );
|
||||||
void setBitrate( unsigned int num );
|
void setBitrate( unsigned int num );
|
||||||
|
|
||||||
|
/* file attributes */
|
||||||
|
void setFileName( const QString& fn );
|
||||||
|
void setFileSize( const QString& size );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::MetadataEditor* ui;
|
Ui::MetadataEditor* ui;
|
||||||
|
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>367</width>
|
<width>404</width>
|
||||||
<height>223</height>
|
<height>298</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@@ -15,23 +15,24 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="title">
|
<property name="currentIndex">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="tabWidgetPage1" native="true">
|
||||||
|
<attribute name="title">
|
||||||
<string>Tags</string>
|
<string>Tags</string>
|
||||||
</property>
|
</attribute>
|
||||||
<property name="flat">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<layout class="QFormLayout" name="formLayout">
|
<layout class="QFormLayout" name="formLayout">
|
||||||
|
<property name="fieldGrowthPolicy">
|
||||||
|
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
||||||
|
</property>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -49,6 +50,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>Artist:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="5" column="1">
|
<item row="5" column="1">
|
||||||
<widget class="QLineEdit" name="artistLineEdit">
|
<widget class="QLineEdit" name="artistLineEdit">
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
@@ -59,6 +67,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="9" column="0">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>Album</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="9" column="1">
|
<item row="9" column="1">
|
||||||
<widget class="QLineEdit" name="albumLineEdit">
|
<widget class="QLineEdit" name="albumLineEdit">
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
@@ -69,6 +84,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="12" column="0">
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="text">
|
||||||
|
<string>Disc Number:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="12" column="1">
|
<item row="12" column="1">
|
||||||
<widget class="QSpinBox" name="discNumberSpinBox">
|
<widget class="QSpinBox" name="discNumberSpinBox">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@@ -91,43 +113,104 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="15" column="0">
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_6">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Artist:</string>
|
<string>Duration:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="0">
|
<item row="15" column="1">
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLineEdit" name="durationLineEdit">
|
||||||
<property name="text">
|
<property name="readOnly">
|
||||||
<string>Album</string>
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>00.00</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="12" column="0">
|
<item row="19" column="0">
|
||||||
<widget class="QLabel" name="label_5">
|
|
||||||
<property name="text">
|
|
||||||
<string>Disc Number:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="13" column="0">
|
|
||||||
<widget class="QLabel" name="label_4">
|
<widget class="QLabel" name="label_4">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Bitrate:</string>
|
<string>Bitrate:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="13" column="1">
|
<item row="19" column="1">
|
||||||
<widget class="QLabel" name="bitrateLabel">
|
<widget class="QLineEdit" name="bitrateLineEdit">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>Bitrate...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="17" column="1">
|
||||||
|
<widget class="QLineEdit" name="yearLineEdit">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>Year...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="17" column="0">
|
||||||
|
<widget class="QLabel" name="label_9">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string>Year:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QWidget" name="tab">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>File</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QFormLayout" name="formLayout_2">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label_7">
|
||||||
|
<property name="text">
|
||||||
|
<string>File Name:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLineEdit" name="fileNameLineEdit">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>File Name...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLineEdit" name="fileSizeLineEdit">
|
||||||
|
<property name="text">
|
||||||
|
<string>File Size...</string>
|
||||||
|
</property>
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>File size...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_8">
|
||||||
|
<property name="text">
|
||||||
|
<string>File Size:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
Reference in New Issue
Block a user