Sayonara Player
Toggle main menu visibility
Loading...
Searching...
No Matches
src
Components
Tagging
Editor.h
1
/* TagEdit.h */
2
3
/* Copyright (C) 2011-2024 Michael Lugmair (Lucio Carreras)
4
*
5
* This file is part of sayonara player
6
*
7
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
*/
20
21
#ifndef TAGEDIT_H
22
#define TAGEDIT_H
23
24
#include <QThread>
25
#include <QPixmap>
26
27
#include "Utils/Pimpl.h"
28
29
class
Genre
;
30
31
namespace
Tagging
32
{
33
class
TagReader
;
34
class
TagWriter
;
35
class
Editor :
36
public
QObject
37
{
38
Q_OBJECT
39
PIMPL(Editor)
40
41
signals:
42
void
sigStarted();
43
void
sigFinished();
44
void
sigProgress(
int
);
45
void
sigMetadataReceived(
const
MetaDataList
& tracks);
46
47
public
:
48
Editor(
const
std::shared_ptr<TagReader>& tagReader,
const
std::shared_ptr<TagWriter>& tagWriter,
49
bool
doSelectiveUpdate, QObject* parent);
50
Editor(
const
std::shared_ptr<TagReader>& tagReader,
const
std::shared_ptr<TagWriter>& tagWriter,
51
const
MetaDataList
& tracks,
bool
doSelectiveUpdate, QObject* parent);
52
~Editor()
override
;
53
54
enum
FailReason
55
{
56
FileNotWriteable = 1,
57
FileNotFound,
58
TagLibError,
59
NoError
60
};
61
66
void
undo
(
int
index);
67
71
void
undoAll
();
72
78
MetaData
metadata
(
int
index)
const
;
79
84
MetaDataList
metadata
()
const
;
85
86
bool
applyRegularExpression(
const
QString& regex,
int
index);
87
92
void
addGenre
(
int
index,
const
Genre
& genre);
93
94
void
deleteGenre(
int
index,
const
Genre
& genre);
95
96
void
renameGenre(
int
idx,
const
Genre
& genre,
const
Genre
& new_genre);
97
102
int
count
()
const
;
103
107
bool
hasChanges
()
const
;
108
114
void
updateTrack
(
int
index,
const
MetaData
& track);
115
121
void
updateCover
(
int
index,
const
QPixmap& cover);
122
127
// void remove_cover(int idx);
128
134
bool
hasCoverReplacement
(
int
index)
const
;
135
140
void
setMetadata
(
const
MetaDataList
& tracks);
141
142
bool
isCoverSupported(
int
index)
const
;
143
144
bool
canLoadEntireAlbum()
const
;
145
void
loadEntireAlbum();
146
147
QMap<QString, FailReason>
failedFiles()
const
;
148
149
public
slots:
150
154
void
commit
();
155
156
private
:
160
void
insertMissingArtistsAndAlbums();
161
void
startSameAlbumCrawler(
const
QString& filepath);
162
163
private
slots:
164
void
loadEntireAlbumFinished();
165
};
166
}
167
168
#endif
// TAGEDIT_H
Genre
Definition
Genre.h:31
MetaDataList
Definition
MetaDataList.h:34
MetaData
Definition
MetaData.h:43
QMap
Definition
org_mpris_media_player2_adaptor.h:21
Tagging::Editor::count
int count() const
gets the number of tracks
Tagging::Editor::hasChanges
bool hasChanges() const
indicates if there are pending changes
Tagging::Editor::commit
void commit()
Commits changes to db.
Tagging::Editor::updateTrack
void updateTrack(int index, const MetaData &track)
writes changes to (changed) metadata for a specific track
Tagging::Editor::addGenre
void addGenre(int index, const Genre &genre)
Add a genre to all (changed) metdata.
Tagging::Editor::hasCoverReplacement
bool hasCoverReplacement(int index) const
remove_cover for a specific track
Tagging::Editor::undoAll
void undoAll()
undo changes for all tracks
Tagging::Editor::metadata
MetaData metadata(int index) const
get the (changed) metadata for a specific index
Tagging::Editor::updateCover
void updateCover(int index, const QPixmap &cover)
update the cover for a specific track.
Tagging::Editor::undo
void undo(int index)
undo changes for a specific track
Tagging::Editor::setMetadata
void setMetadata(const MetaDataList &tracks)
initializes the TagEdit object with a MetaDataList
Tagging::Editor::metadata
MetaDataList metadata() const
get all (changed) metadata
Tagging::TagReader
Definition
TagReader.h:34
Tagging::TagWriter
Definition
TagWriter.h:33
Tagging
The GUI_TagEdit class.
Definition
Engine.h:33
Generated on
for Sayonara Player by
1.17.0