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 DirectorySelectionHandler(Library::Manager* libraryManager, QObject* parent = nullptr);
55
56 void playNext(const QStringList& paths);
57 void createPlaylist(const QStringList& paths, bool createNewPlaylist);
58 void appendTracks(const QStringList& paths);
59 void prepareTracksForPlaylist(const QStringList& paths, bool createNewPlaylist);
60
61 void requestImport(LibraryId libId, const QStringList& paths, const QString& targetDirectory);
62
63 void setLibraryId(LibraryId libId);
64 LibraryId libraryId() const;
65
66 void createNewLibrary(const QString& name, const QString& path);
67
68 Library::Info libraryInfo() const;
69 LocalLibrary* libraryInstance() const;
70
71 void setSearchText(const QString& text);
72
73 void copyPaths(const QStringList& paths, const QString& target);
74 void movePaths(const QStringList& paths, const QString& target);
75 void renamePath(const QString& path, const QString& newName);
76 void renameByExpression(const QString& path, const QString& expression);
77 void deletePaths(const QStringList& paths);
78
79 private slots:
80 void librariesChanged();
81};
82
83#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