PageRenderTime 84ms CodeModel.GetById 70ms app.highlight 6ms RepoModel.GetById 7ms app.codeStats 0ms

/xbmc/dialogs/GUIDialogSmartPlaylistEditor.h

http://github.com/xbmc/xbmc
C Header | 64 lines | 46 code | 10 blank | 8 comment | 0 complexity | 3d424e0df8f45aa0466585b1e69a8d13 MD5 | raw file
 1/*
 2 *  Copyright (C) 2005-2018 Team Kodi
 3 *  This file is part of Kodi - https://kodi.tv
 4 *
 5 *  SPDX-License-Identifier: GPL-2.0-or-later
 6 *  See LICENSES/README.md for more information.
 7 */
 8
 9#pragma once
10
11#include "guilib/GUIDialog.h"
12#include "playlists/SmartPlayList.h"
13
14class CFileItemList;
15
16class CGUIDialogSmartPlaylistEditor :
17      public CGUIDialog
18{
19public:
20  enum PLAYLIST_TYPE { TYPE_SONGS = 1, TYPE_ALBUMS, TYPE_ARTISTS, TYPE_MIXED, TYPE_MUSICVIDEOS, TYPE_MOVIES, TYPE_TVSHOWS, TYPE_EPISODES };
21
22  CGUIDialogSmartPlaylistEditor(void);
23  ~CGUIDialogSmartPlaylistEditor(void) override;
24  bool OnMessage(CGUIMessage& message) override;
25  bool OnBack(int actionID) override;
26  void OnInitWindow() override;
27  void OnDeinitWindow(int nextWindowID) override;
28
29  static bool EditPlaylist(const std::string &path, const std::string &type = "");
30  static bool NewPlaylist(const std::string &type);
31
32protected:
33  void OnRuleList(int item);
34  void OnRuleAdd();
35  void OnRuleRemove(int item);
36  void OnMatch();
37  void OnLimit();
38  void OnName();
39  void OnType();
40  void OnOrder();
41  void OnOrderDirection();
42  void OnGroupBy();
43  void OnGroupMixed();
44  void OnOK();
45  void OnCancel();
46  void OnPopupMenu(int item);
47  void UpdateButtons();
48  void UpdateRuleControlButtons();
49  int GetSelectedItem();
50  void HighlightItem(int item);
51  std::vector<PLAYLIST_TYPE> GetAllowedTypes(const std::string& mode);
52  PLAYLIST_TYPE ConvertType(const std::string &type);
53  std::string ConvertType(PLAYLIST_TYPE type);
54  std::string GetLocalizedType(PLAYLIST_TYPE type);
55
56  CSmartPlaylist m_playlist;
57
58  // our list of rules for display purposes
59  CFileItemList* m_ruleLabels;
60
61  std::string m_path;
62  bool m_cancelled;
63  std::string m_mode;  // mode we're in (partymode etc.)
64};