Sayonara Player
Loading...
Searching...
No Matches
Bookmarks.h
1/* Bookmarks.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 BOOKMARKS_H
22#define BOOKMARKS_H
23
24#include "BookmarkStorage.h"
25
26#include <QList>
27#include <QObject>
28
29class Bookmark;
30class MetaData;
31class PlayManager;
32
33class Bookmarks :
34 public QObject
35{
36 Q_OBJECT
37 PIMPL(Bookmarks)
38
39 signals:
40 void sigBookmarksChanged();
41 void sigPreviousChanged(const Bookmark& bm);
42 void sigNextChanged(const Bookmark& bm);
43
44 public:
45 explicit Bookmarks(PlayManager* playManager, QObject* parent = nullptr);
46 ~Bookmarks() override;
47
48 bool jumpTo(int idx);
49 bool jumpNext();
50 bool jumpPrevious();
51 bool setLoop(bool b);
52
53 [[nodiscard]] int count() const;
54
55 BookmarkStorage::CreationStatus create();
56
57 bool remove(int index);
58 [[nodiscard]] const QList<Bookmark>& bookmarks() const;
59
60 [[nodiscard]] const MetaData& currentTrack() const;
61
62 private slots:
63 void positionChangedMs(MilliSeconds positionMs);
64 void currentTrackChanged(const MetaData& track);
65 void playstateChanged(PlayState state);
66};
67
68#endif // BOOKMARKS_H
Definition Bookmark.h:32
Definition Bookmarks.h:35
Definition MetaData.h:43
Definition PlayManager.h:34
Definition EngineUtils.h:33