TTKMusicPlayer  4.2.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
Signals | Public Member Functions | Private Member Functions | Private Attributes | List of all members
MusicBackgroundManager Class Reference

The class of the manager of dealing with artist pictures. More...

#include <musicbackgroundmanager.h>

+ Inheritance diagram for MusicBackgroundManager:

Signals

void artistChanged ()
 
void backgroundChanged ()
 
void selectIndexChanged ()
 

Public Member Functions

void setArtistName (const QString &name)
 
QString artistName () const noexcept
 
int currentIndex () const noexcept
 
void setCurrentIndex (int index) noexcept
 
int count () const noexcept
 
bool isEmpty () const noexcept
 
void imageNext () noexcept
 
void imagePrevious () noexcept
 
QString artistImagePath () noexcept
 
QString artistImageDefaultPath () const noexcept
 
void updateArtistImageList ()
 
QStringList artistImageList () const noexcept
 
void setArtistImageList (const QStringList &list) noexcept
 
void setSelectArtistIndex (int index) noexcept
 
void addObserver (QObject *object)
 
void removeObserver (QObject *object)
 
void setBackgroundUrl (const QString &path) noexcept
 
QString backgroundUrl () const noexcept
 

Private Member Functions

 MusicBackgroundManager () noexcept
 

Private Attributes

int m_currentIndex
 
QStringList m_images
 
QObjectList m_observer
 
QString m_currentArtistName
 
QString m_background
 

Detailed Description

The class of the manager of dealing with artist pictures.

Author
Greedysky greed.nosp@m.ysky.nosp@m.@163..nosp@m.com

Definition at line 28 of file musicbackgroundmanager.h.

Constructor & Destructor Documentation

MusicBackgroundManager::MusicBackgroundManager ( )
privatenoexcept

Object constructor.

Definition at line 4 of file musicbackgroundmanager.cpp.

Member Function Documentation

void MusicBackgroundManager::addObserver ( QObject *  object)

Add observer.

Definition at line 90 of file musicbackgroundmanager.cpp.

References backgroundChanged(), and m_observer.

void MusicBackgroundManager::artistChanged ( )
signal

New artist has been set.

Referenced by updateArtistImageList().

QString MusicBackgroundManager::artistImageDefaultPath ( ) const
noexcept

Get artist image path by default.

Definition at line 41 of file musicbackgroundmanager.cpp.

References m_currentIndex, and m_images.

QStringList MusicBackgroundManager::artistImageList ( ) const
noexcept

Get artist image path list.

Definition at line 74 of file musicbackgroundmanager.cpp.

References m_images.

QString MusicBackgroundManager::artistImagePath ( )
noexcept

Get artist image path.

Definition at line 31 of file musicbackgroundmanager.cpp.

References m_currentIndex, and m_images.

QString MusicBackgroundManager::artistName ( ) const
noexcept

Get current artist name.

Definition at line 16 of file musicbackgroundmanager.cpp.

References m_currentArtistName.

void MusicBackgroundManager::backgroundChanged ( )
signal

Background image changed.

Referenced by addObserver(), and removeObserver().

QString MusicBackgroundManager::backgroundUrl ( ) const
noexcept

Get artist background picture path.

Definition at line 108 of file musicbackgroundmanager.cpp.

References m_background.

int MusicBackgroundManager::count ( ) const
inlinenoexcept

Get artist image count.

Definition at line 54 of file musicbackgroundmanager.h.

int MusicBackgroundManager::currentIndex ( ) const
inlinenoexcept

Get artist image current index.

Definition at line 46 of file musicbackgroundmanager.h.

void MusicBackgroundManager::imageNext ( )
noexcept

Set artist image current index + 1.

Definition at line 21 of file musicbackgroundmanager.cpp.

References m_currentIndex.

void MusicBackgroundManager::imagePrevious ( )
noexcept

Set artist image current index - 1.

Definition at line 26 of file musicbackgroundmanager.cpp.

References m_currentIndex.

bool MusicBackgroundManager::isEmpty ( ) const
inlinenoexcept

Get artist image count is 0.

Definition at line 58 of file musicbackgroundmanager.h.

void MusicBackgroundManager::removeObserver ( QObject *  object)

Remove observer.

Definition at line 96 of file musicbackgroundmanager.cpp.

References backgroundChanged(), and m_observer.

void MusicBackgroundManager::selectIndexChanged ( )
signal

User selected index changed.

void MusicBackgroundManager::setArtistImageList ( const QStringList &  list)
noexcept

Set artist image path by given path list.

Definition at line 79 of file musicbackgroundmanager.cpp.

void MusicBackgroundManager::setArtistName ( const QString &  name)

Set current artist name.

Definition at line 10 of file musicbackgroundmanager.cpp.

References TTK::generateSongArtist(), m_currentArtistName, and updateArtistImageList().

void MusicBackgroundManager::setBackgroundUrl ( const QString &  path)
noexcept

Set artist background picture by path.

Definition at line 102 of file musicbackgroundmanager.cpp.

void MusicBackgroundManager::setCurrentIndex ( int  index)
inlinenoexcept

Set artist image current index.

Definition at line 50 of file musicbackgroundmanager.h.

void MusicBackgroundManager::setSelectArtistIndex ( int  index)
noexcept

Set user select current index.

Definition at line 84 of file musicbackgroundmanager.cpp.

void MusicBackgroundManager::updateArtistImageList ( )

Update artist image list.

Definition at line 52 of file musicbackgroundmanager.cpp.

References artistChanged(), BACKGROUND_DIR_FULL, m_currentArtistName, m_currentIndex, m_images, MAX_IMAGE_COUNT, and SKN_FILE.

Referenced by setArtistName().

Member Data Documentation

QString MusicBackgroundManager::m_background
private

Definition at line 136 of file musicbackgroundmanager.h.

Referenced by backgroundUrl().

QString MusicBackgroundManager::m_currentArtistName
private

Definition at line 136 of file musicbackgroundmanager.h.

Referenced by artistName(), setArtistName(), and updateArtistImageList().

int MusicBackgroundManager::m_currentIndex
private
QStringList MusicBackgroundManager::m_images
private
QObjectList MusicBackgroundManager::m_observer
private

Definition at line 135 of file musicbackgroundmanager.h.

Referenced by addObserver(), and removeObserver().


The documentation for this class was generated from the following files: