Sayonara Player
Public Types | Signals | Public Member Functions | List of all members
Bookmarks Class Reference

#include <Bookmarks.h>

Detailed Description

The Bookmarks logic class.

Public Types

enum  CreationStatus : unsigned char {
  Success,
  AlreadyThere,
  NoDBTrack,
  DBError,
  OtherError
}
 

Signals

void sig_bookmarks_changed ()
 emitted when bookmarks have changed More...
 
void sig_prev_changed (const Bookmark &bm)
 previous bookmark has changed More...
 
void sig_next_changed (const Bookmark &bm)
 next bookmark has changed More...
 

Public Member Functions

 Bookmarks (QObject *parent)
 
bool jump_to (int idx)
 Jump to specific bookmark. More...
 
bool jump_next ()
 Jump to next bookmark. More...
 
bool jump_prev ()
 Jump to previous bookmark. More...
 
bool set_loop (bool b)
 tries to set the loop between the current two indices More...
 
BookmarksBase::CreationStatus create ()
 
bool remove (int idx) override
 remove single bookmark from database for current track More...
 
virtual CreationStatus create (Seconds timestamp)
 create a new bookmark for current track and current position More...
 
MetaData metadata () const
 get the current track More...
 
void set_metadata (const MetaData &md)
 
const QList< Bookmarkbookmarks () const
 
void set_bookmarks (const QList< Bookmark > bookmarks)
 
int count ()
 
void add (const Bookmark &bookmark)
 
void clear ()
 
const Bookmarkbookmark (int idx) const
 
Bookmarkbookmark (int idx)
 
void sort ()
 

Member Function Documentation

◆ create()

virtual CreationStatus BookmarksBase::create ( Seconds  timestamp)
virtualinherited

create a new bookmark for current track and current position

Returns
true if successful, else false

◆ jump_next()

bool Bookmarks::jump_next ( )

Jump to next bookmark.

Returns
true if successful, false else

◆ jump_prev()

bool Bookmarks::jump_prev ( )

Jump to previous bookmark.

Returns
true if successful, false else

◆ jump_to()

bool Bookmarks::jump_to ( int  idx)

Jump to specific bookmark.

Parameters
idxbookmark index
Returns
true if index was valid

◆ metadata()

MetaData BookmarksBase::metadata ( ) const
inherited

get the current track

Returns

◆ remove()

bool Bookmarks::remove ( int  idx)
overridevirtual

remove single bookmark from database for current track

Parameters
idxindex
Returns

Reimplemented from BookmarksBase.

◆ set_loop()

bool Bookmarks::set_loop ( bool  b)

tries to set the loop between the current two indices

Parameters
bswitch loop on or off
Returns
false if the two current indices are invalid or if b == false. True else

◆ sig_bookmarks_changed

void Bookmarks::sig_bookmarks_changed ( )
signal

emitted when bookmarks have changed

Parameters
bookmarksnew bookmarks

◆ sig_next_changed

void Bookmarks::sig_next_changed ( const Bookmark bm)
signal

next bookmark has changed

Parameters
bmnew bookmark. Check for Bookmark::is_valid()

◆ sig_prev_changed

void Bookmarks::sig_prev_changed ( const Bookmark bm)
signal

previous bookmark has changed

Parameters
bmnew bookmark. Check for Bookmark::is_valid()
Inheritance diagram for Bookmarks:
BookmarksBase