added config
This commit is contained in:
parent
893a2990af
commit
f02f439790
7 changed files with 168 additions and 17 deletions
|
|
@ -9,19 +9,50 @@ class NavigationListModel;
|
|||
class UiStateModel;
|
||||
class MusicController;
|
||||
|
||||
/**
|
||||
* @brief Main controller controlling ui state, navigation and music player.
|
||||
*/
|
||||
class NavigationController : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit NavigationController(QObject *parent = nullptr);
|
||||
|
||||
/**
|
||||
* @brief Setup navigation model parsing all directories under rootPath
|
||||
* @param rootPath path to root directory containing music
|
||||
*/
|
||||
void init(const QString & rootPath);
|
||||
/**
|
||||
* @brief Set ui profile
|
||||
* @param profileString String defining profile
|
||||
* @see UiStateModel::setProfile(const QString& profileString)
|
||||
*/
|
||||
void setUiProfile(const QString& profileString);
|
||||
|
||||
/**
|
||||
* @brief setContext set QML Context and context properties
|
||||
* @param context QmlContext
|
||||
* @see setContextProperties
|
||||
*/
|
||||
void setContext(QQmlContext* context);
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief Register models in context
|
||||
*/
|
||||
void setContextProperties();
|
||||
/**
|
||||
* @brief Add a directory and its subdirectories to navigation
|
||||
* @param path Path to directory
|
||||
* @param parentItem Parent directory
|
||||
*/
|
||||
void add(const QString & path, NavigationItemModel* parentItem);
|
||||
/**
|
||||
* @brief Check whether directory contains either a subdirectory or flac or mp3 music files
|
||||
* @param path path to directory
|
||||
* @return true if directory is valid
|
||||
*/
|
||||
bool checkContent(const QString& path);
|
||||
|
||||
NavigationItemModel* mRootItem;
|
||||
|
|
@ -35,6 +66,9 @@ private:
|
|||
QQmlContext* mContext = nullptr;
|
||||
|
||||
private slots:
|
||||
/**
|
||||
* @brief Either show subdirectories or music player depending on current directory type
|
||||
*/
|
||||
void onNavigationRequest();
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue