Sayonara Player
Toggle main menu visibility
Loading...
Searching...
No Matches
src
Components
Playlist
PlaylistHandler.h
1
/* Playlist.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
22
/*
23
* Playlist.h
24
*
25
* Created on: Apr 6, 2011
26
* Author: Michael Lugmair (Lucio Carreras)
27
*/
28
29
#ifndef SAYONARA_PLAYLISTHANDLER_H
30
#define SAYONARA_PLAYLISTHANDLER_H
31
32
#include "PlaylistDBInterface.h"
33
#include "PlaylistInterface.h"
34
35
#include "Utils/Pimpl.h"
36
#include "Utils/Playlist/PlaylistFwd.h"
37
#include "Utils/Library/LibraryNamespaces.h"
38
39
#include <QObject>
40
41
class
CustomPlaylist
;
42
class
PlayManager
;
43
44
namespace
Util
45
{
46
class
FileSystem
;
47
}
48
49
namespace
Playlist
50
{
51
class
LocalPathPlaylistCreator
;
52
class
Loader
;
53
class
Handler :
54
public
QObject,
55
public
Creator
,
56
public
Accessor
57
{
58
Q_OBJECT
59
PIMPL(Handler)
60
61
public
:
62
Handler(
PlayManager
* playManager,
const
std::shared_ptr<Loader>& playlistLoader,
63
const
std::shared_ptr<Util::FileSystem>& fileSystem);
64
~Handler()
override
;
65
66
void
shutdown();
67
68
[[nodiscard]]
int
count()
const override
;
69
70
PlaylistPtr playlist(
int
playlistIndex)
override
;
71
PlaylistPtr playlistById(
int
playlistId)
override
;
72
73
[[nodiscard]]
int
activeIndex()
const override
;
74
75
[[nodiscard]]
int
currentIndex()
const override
;
76
void
setCurrentIndex(
int
playlistIndex)
override
;
77
78
[[nodiscard]] QString requestNewPlaylistName(
const
QString& prefix = QString())
const override
;
79
80
int
81
createPlaylist(
const
MetaDataList
& tracks,
const
QString& name = QString(),
bool
temporary =
true
,
82
bool
isLocked =
false
)
override
;
83
84
int
createPlaylist(
const
QStringList& paths,
const
QString& name = QString(),
bool
temporary =
true
,
85
LocalPathPlaylistCreator
* playlistFromPathCreator =
nullptr
)
override
;
86
87
int
createPlaylist(
const
CustomPlaylist
& playlist)
override
;
88
int
createCommandLinePlaylist(
const
QStringList& pathList,
89
LocalPathPlaylistCreator
* playlistFromPathCreator)
override
;
90
91
int
createEmptyPlaylist(
bool
override
=
false
)
override
;
92
93
public
slots:
// NOLINT(readability-redundant-access-specifiers)
94
void
closePlaylist(
int
playlistIndex);
95
96
private
:
97
int
addNewPlaylist(
const
QString& name,
bool
editable,
bool
overwriteLocked);
98
[[nodiscard]]
int
exists(
const
QString& name)
const
;
99
PlaylistPtr determineActivePlaylist();
100
101
private
slots:
// NOLINT(readability-redundant-access-specifiers)
102
void
trackChanged(
int
oldIndex,
int
newIndex);
103
void
previous();
104
void
next();
105
void
continueFromStop();
106
void
playstateChanged(PlayState state);
107
void
wwwTrackFinished(
const
MetaData
& track);
108
void
playlistRenamed(
int
id
,
const
QString& oldNamde,
const
QString& newName);
109
void
playlistDeleted(
int
id
);
110
111
signals:
112
void
sigNewPlaylistAdded(
int
playlistIndex);
113
void
sigPlaylistNameChanged(
int
playlistIndex);
114
void
sigCurrentPlaylistChanged(
int
playlistIndex);
115
void
sigActivePlaylistChanged(
int
playlistIndex);
116
void
sigTrackDeletionRequested(
const
MetaDataList
& tracks, Library::TrackDeletionMode deletion_mode);
117
void
sigPlaylistClosed(
int
playlistIndex);
118
};
119
}
120
121
#endif
/* SAYONARA_PLAYLISTHANDLER_H */
CustomPlaylist
Definition
CustomPlaylist.h:30
MetaDataList
Definition
MetaDataList.h:34
MetaData
Definition
MetaData.h:43
PlayManager
Definition
PlayManager.h:34
Playlist::Accessor
Definition
PlaylistInterface.h:43
Playlist::Creator
Definition
PlaylistInterface.h:59
Playlist::Loader
The PlaylistLoader class.
Definition
PlaylistLoader.h:36
Playlist::LocalPathPlaylistCreator
Definition
LocalPathPlaylistCreator.h:36
Util::FileSystem
Definition
FileSystem.h:34
Util
Helper functions.
Definition
MetaTypeRegistry.h:25
Generated on
for Sayonara Player by
1.17.0