Sayonara Player
Bookmarks.h
1/* Bookmarks.h */
2
3/* Copyright (C) 2011-2020 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
37class Bookmarks :
38 public QObject
39{
40 Q_OBJECT
41 PIMPL(Bookmarks)
42
43 signals:
49
55
60 void sigNextChanged(const Bookmark& bm);
61
62 public:
63 explicit Bookmarks(PlayManager* playManager, QObject* parent=nullptr);
64 ~Bookmarks() override;
65
71 bool jumpTo(int idx);
72
77 bool jumpNext();
78
84
90 bool setLoop(bool b);
91
92 int count() const;
93
94 BookmarkStorage::CreationStatus create();
95
96 bool remove(int index);
97 const QList<Bookmark>& bookmarks() const;
98
99 const MetaData& currentTrack() const;
100
101 private slots:
106 void positionChangedMs(MilliSeconds positionMs);
107
112 void currentTrackChanged(const MetaData& track);
113
118 void playstateChanged(PlayState state);
119};
120
121#endif // BOOKMARKS_H
Definition: Bookmark.h:32
The Bookmarks logic class.
Definition: Bookmarks.h:39
void sigNextChanged(const Bookmark &bm)
next bookmark has changed
void sigPreviousChanged(const Bookmark &bm)
previous bookmark has changed
void sigBookmarksChanged()
emitted when bookmarks have changed
bool setLoop(bool b)
tries to set the loop between the current two indices
bool jumpPrevious()
Jump to previous bookmark.
bool jumpNext()
Jump to next bookmark.
bool jumpTo(int idx)
Jump to specific bookmark.
The MetaData class.
Definition: MetaData.h:47
Global handler for current playback state (Singleton)
Definition: PlayManager.h:36
Definition: EngineUtils.h:33