Sayonara Player
Loading...
Searching...
No Matches
DirectorySelectionHandler.h
1/* DirectorySelectionHandler.h
2 *
3 * Copyright (C) 2011-2024 Michael Lugmair
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 DIRECTORYSELECTIONHANDLER_H
22#define DIRECTORYSELECTIONHANDLER_H
23
24#include "Utils/Pimpl.h"
25#include <QObject>
26
27namespace Library
28{
29 class Info;
30 class Manager;
31}
32
33class FileOperations;
34class LocalLibrary;
35class QStringList;
36
38 public QObject
39{
40 Q_OBJECT
42
43 signals:
44 void sigLibrariesChanged();
45 void sigImportDialogRequested(const QString& targetPath);
46 void sigFileOperationStarted();
47 void sigFileOperationFinished();
48
49 private:
50 FileOperations* createFileOperation();
51
52 public:
53 explicit DirectorySelectionHandler(Library::Manager* libraryManager, QObject* parent = nullptr);
55
56 void playNext(const QStringList& paths) const;
57 void createPlaylist(const QStringList& paths, bool createNewPlaylist) const;
58 void appendTracks(const QStringList& paths) const;
59 void prepareTracksForPlaylist(const QStringList& paths, bool createNewPlaylist) const;
60
61 void requestImport(LibraryId libId, const QStringList& paths, const QString& targetDirectory) const;
62
63 void setLibraryId(LibraryId libId);
64 [[nodiscard]] LibraryId libraryId() const;
65
66 [[nodiscard]] Library::Info libraryInfo() const;
67 [[nodiscard]] LocalLibrary* libraryInstance() const;
68
69 void copyPaths(const QStringList& paths, const QString& target);
70 void movePaths(const QStringList& paths, const QString& target);
71 void renamePath(const QString& path, const QString& newName);
72 void renameByExpression(const QString& path, const QString& expression);
73 void deletePaths(const QStringList& paths);
74
75 private slots:
76 void librariesChanged();
77};
78
79#endif // DIRECTORYSELECTIONHANDLER_H
Definition: DirectorySelectionHandler.h:39
Definition: FileOperations.h:36
The Info class.
Definition: LibraryInfo.h:38
Definition: LibraryManager.h:50
Definition: LocalLibrary.h:38