xbmc
InfoTagMusic.h
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 "AddonClass.h"
12 
13 #include <vector>
14 
15 namespace MUSIC_INFO
16 {
17 class CMusicInfoTag;
18 }
19 
20 namespace XBMCAddon
21 {
22  namespace xbmc
23  {
24  //
46  //
47  class InfoTagMusic : public AddonClass
48  {
49  private:
51  bool offscreen;
52  bool owned;
53 
54  public:
55 #ifndef SWIG
56  explicit InfoTagMusic(const MUSIC_INFO::CMusicInfoTag* tag);
57  explicit InfoTagMusic(MUSIC_INFO::CMusicInfoTag* tag, bool offscreen = false);
58 #endif
59 
60 #ifdef DOXYGEN_SHOULD_USE_THIS
61  InfoTagMusic(...);
92 #else
93  explicit InfoTagMusic(bool offscreen = false);
94 #endif
95  ~InfoTagMusic() override;
96 
97 #ifdef DOXYGEN_SHOULD_USE_THIS
98  getDbId();
110 #else
111  int getDbId();
112 #endif
113 
114 #ifdef DOXYGEN_SHOULD_USE_THIS
115  getURL();
127 #else
128  String getURL();
129 #endif
130 
131 #ifdef DOXYGEN_SHOULD_USE_THIS
132  getTitle();
144 #else
145  String getTitle();
146 #endif
147 
148 #ifdef DOXYGEN_SHOULD_USE_THIS
149  getMediaType();
167 #else
168  String getMediaType();
169 #endif
170 
171 #ifdef DOXYGEN_SHOULD_USE_THIS
172  getArtist();
184 #else
185  String getArtist();
186 #endif
187 
188 
189 #ifdef DOXYGEN_SHOULD_USE_THIS
190  getAlbum();
202 #else
203  String getAlbum();
204 #endif
205 
206 
207 #ifdef DOXYGEN_SHOULD_USE_THIS
208  getAlbumArtist();
220 #else
221  String getAlbumArtist();
222 #endif
223 
224 
225 #ifdef DOXYGEN_SHOULD_USE_THIS
226  getGenre();
238 #else
239  String getGenre();
240 #endif
241 
242 
243 #ifdef DOXYGEN_SHOULD_USE_THIS
244  getGenres();
256 #else
257  std::vector<String> getGenres();
258 #endif
259 
260 
261 #ifdef DOXYGEN_SHOULD_USE_THIS
262  getDuration();
274 #else
275  int getDuration();
276 #endif
277 
278 
279 #ifdef DOXYGEN_SHOULD_USE_THIS
280  getYear();
293 #else
294  int getYear();
295 #endif
296 
297 #ifdef DOXYGEN_SHOULD_USE_THIS
298  getRating();
310 #else
311  int getRating();
312 #endif
313 
314 #ifdef DOXYGEN_SHOULD_USE_THIS
315  getUserRating();
327 #else
328  int getUserRating();
329 #endif
330 
331 #ifdef DOXYGEN_SHOULD_USE_THIS
332  getTrack();
344 #else
345  int getTrack();
346 #endif
347 
348 #ifdef DOXYGEN_SHOULD_USE_THIS
349  getDisc();
361 #else
362 
365  int getDisc();
366 #endif
367 
368 #ifdef DOXYGEN_SHOULD_USE_THIS
369  getReleaseDate();
381 #else
382  String getReleaseDate();
383 #endif
384 
385 #ifdef DOXYGEN_SHOULD_USE_THIS
386  getListeners();
398 #else
399  int getListeners();
400 #endif
401 
402 #ifdef DOXYGEN_SHOULD_USE_THIS
403  getPlayCount();
415 #else
416  int getPlayCount();
417 #endif
418 
419 #ifdef DOXYGEN_SHOULD_USE_THIS
420  getLastPlayed();
432 #else
433  String getLastPlayed();
434 #endif
435 
436 #ifdef DOXYGEN_SHOULD_USE_THIS
437  getLastPlayedAsW3C();
449 #else
450  String getLastPlayedAsW3C();
451 #endif
452 
453 #ifdef DOXYGEN_SHOULD_USE_THIS
454  getComment();
466 #else
467  String getComment();
468 #endif
469 
470 #ifdef DOXYGEN_SHOULD_USE_THIS
471  getLyrics();
483 #else
484  String getLyrics();
485 #endif
486 
487 #ifdef DOXYGEN_SHOULD_USE_THIS
488  getMusicBrainzTrackID();
500 #else
501  String getMusicBrainzTrackID();
502 #endif
503 
504 #ifdef DOXYGEN_SHOULD_USE_THIS
505  getMusicBrainzArtistID();
517 #else
518  std::vector<String> getMusicBrainzArtistID();
519 #endif
520 
521 #ifdef DOXYGEN_SHOULD_USE_THIS
522  getMusicBrainzAlbumID();
534 #else
535  String getMusicBrainzAlbumID();
536 #endif
537 
538 #ifdef DOXYGEN_SHOULD_USE_THIS
539  getMusicBrainzReleaseGroupID();
551 #else
552  String getMusicBrainzReleaseGroupID();
553 #endif
554 
555 #ifdef DOXYGEN_SHOULD_USE_THIS
556  getMusicBrainzAlbumArtistID();
568 #else
569  std::vector<String> getMusicBrainzAlbumArtistID();
570 #endif
571 
572 #ifdef DOXYGEN_SHOULD_USE_THIS
573  setDbId(...);
586 #else
587  void setDbId(int dbId, const String& type);
588 #endif
589 
590 #ifdef DOXYGEN_SHOULD_USE_THIS
591  setURL(...);
603 #else
604  void setURL(const String& url);
605 #endif
606 
607 #ifdef DOXYGEN_SHOULD_USE_THIS
608  setMediaType(...);
620 #else
621  void setMediaType(const String& mediaType);
622 #endif
623 
624 #ifdef DOXYGEN_SHOULD_USE_THIS
625  setTrack(...);
637 #else
638  void setTrack(int track);
639 #endif
640 
641 #ifdef DOXYGEN_SHOULD_USE_THIS
642  setDisc(...);
654 #else
655  void setDisc(int disc);
656 #endif
657 
658 #ifdef DOXYGEN_SHOULD_USE_THIS
659  setDuration(...);
671 #else
672  void setDuration(int duration);
673 #endif
674 
675 #ifdef DOXYGEN_SHOULD_USE_THIS
676  setYear(...);
688 #else
689  void setYear(int year);
690 #endif
691 
692 #ifdef DOXYGEN_SHOULD_USE_THIS
693  setReleaseDate(...);
705 #else
706  void setReleaseDate(const String& releaseDate);
707 #endif
708 
709 #ifdef DOXYGEN_SHOULD_USE_THIS
710  setListeners(...);
722 #else
723  void setListeners(int listeners);
724 #endif
725 
726 #ifdef DOXYGEN_SHOULD_USE_THIS
727  setPlayCount(...);
739 #else
740  void setPlayCount(int playcount);
741 #endif
742 
743 #ifdef DOXYGEN_SHOULD_USE_THIS
744  setGenres(...);
756 #else
757  void setGenres(const std::vector<String>& genres);
758 #endif
759 
760 #ifdef DOXYGEN_SHOULD_USE_THIS
761  setAlbum(...);
773 #else
774  void setAlbum(const String& album);
775 #endif
776 
777 #ifdef DOXYGEN_SHOULD_USE_THIS
778  setArtist(...);
790 #else
791  void setArtist(const String& artist);
792 #endif
793 
794 #ifdef DOXYGEN_SHOULD_USE_THIS
795  setAlbumArtist(...);
807 #else
808  void setAlbumArtist(const String& albumArtist);
809 #endif
810 
811 #ifdef DOXYGEN_SHOULD_USE_THIS
812  setTitle(...);
824 #else
825  void setTitle(const String& title);
826 #endif
827 
828 #ifdef DOXYGEN_SHOULD_USE_THIS
829  setRating(...);
841 #else
842  void setRating(float rating);
843 #endif
844 
845 #ifdef DOXYGEN_SHOULD_USE_THIS
846  setUserRating(...);
858 #else
859  void setUserRating(int userrating);
860 #endif
861 
862 #ifdef DOXYGEN_SHOULD_USE_THIS
863  setLyrics(...);
875 #else
876  void setLyrics(const String& lyrics);
877 #endif
878 
879 #ifdef DOXYGEN_SHOULD_USE_THIS
880  setLastPlayed(...);
892 #else
893  void setLastPlayed(const String& lastPlayed);
894 #endif
895 
896 #ifdef DOXYGEN_SHOULD_USE_THIS
897  setMusicBrainzTrackID(...);
909 #else
910  void setMusicBrainzTrackID(const String& musicBrainzTrackID);
911 #endif
912 
913 #ifdef DOXYGEN_SHOULD_USE_THIS
914  setMusicBrainzArtistID(...);
926 #else
927  void setMusicBrainzArtistID(const std::vector<String>& musicBrainzArtistID);
928 #endif
929 
930 #ifdef DOXYGEN_SHOULD_USE_THIS
931  setMusicBrainzAlbumID(...);
943 #else
944  void setMusicBrainzAlbumID(const String& musicBrainzAlbumID);
945 #endif
946 
947 #ifdef DOXYGEN_SHOULD_USE_THIS
948  setMusicBrainzReleaseGroupID(...);
960 #else
961  void setMusicBrainzReleaseGroupID(const String& musicBrainzReleaseGroupID);
962 #endif
963 
964 #ifdef DOXYGEN_SHOULD_USE_THIS
965  setMusicBrainzAlbumArtistID(...);
977 #else
978  void setMusicBrainzAlbumArtistID(const std::vector<String>& musicBrainzAlbumArtistID);
979 #endif
980 
981 #ifdef DOXYGEN_SHOULD_USE_THIS
982  setComment(...);
994 #else
995  void setComment(const String& comment);
996 #endif
997 
998 #ifndef SWIG
999  static void setDbIdRaw(MUSIC_INFO::CMusicInfoTag* infoTag, int dbId, const String& type);
1000  static void setURLRaw(MUSIC_INFO::CMusicInfoTag* infoTag, const String& url);
1001  static void setMediaTypeRaw(MUSIC_INFO::CMusicInfoTag* infoTag, const String& mediaType);
1002  static void setTrackRaw(MUSIC_INFO::CMusicInfoTag* infoTag, int track);
1003  static void setDiscRaw(MUSIC_INFO::CMusicInfoTag* infoTag, int disc);
1004  static void setDurationRaw(MUSIC_INFO::CMusicInfoTag* infoTag, int duration);
1005  static void setYearRaw(MUSIC_INFO::CMusicInfoTag* infoTag, int year);
1006  static void setReleaseDateRaw(MUSIC_INFO::CMusicInfoTag* infoTag, const String& releaseDate);
1007  static void setListenersRaw(MUSIC_INFO::CMusicInfoTag* infoTag, int listeners);
1008  static void setPlayCountRaw(MUSIC_INFO::CMusicInfoTag* infoTag, int playcount);
1009  static void setGenresRaw(MUSIC_INFO::CMusicInfoTag* infoTag,
1010  const std::vector<String>& genres);
1011  static void setAlbumRaw(MUSIC_INFO::CMusicInfoTag* infoTag, const String& album);
1012  static void setArtistRaw(MUSIC_INFO::CMusicInfoTag* infoTag, const String& artist);
1013  static void setAlbumArtistRaw(MUSIC_INFO::CMusicInfoTag* infoTag, const String& albumArtist);
1014  static void setTitleRaw(MUSIC_INFO::CMusicInfoTag* infoTag, const String& title);
1015  static void setRatingRaw(MUSIC_INFO::CMusicInfoTag* infoTag, float rating);
1016  static void setUserRatingRaw(MUSIC_INFO::CMusicInfoTag* infoTag, int userrating);
1017  static void setLyricsRaw(MUSIC_INFO::CMusicInfoTag* infoTag, const String& lyrics);
1018  static void setLastPlayedRaw(MUSIC_INFO::CMusicInfoTag* infoTag, const String& lastPlayed);
1019  static void setMusicBrainzTrackIDRaw(MUSIC_INFO::CMusicInfoTag* infoTag,
1020  const String& musicBrainzTrackID);
1021  static void setMusicBrainzArtistIDRaw(MUSIC_INFO::CMusicInfoTag* infoTag,
1022  const std::vector<String>& musicBrainzArtistID);
1023  static void setMusicBrainzAlbumIDRaw(MUSIC_INFO::CMusicInfoTag* infoTag,
1024  const String& musicBrainzAlbumID);
1025  static void setMusicBrainzReleaseGroupIDRaw(MUSIC_INFO::CMusicInfoTag* infoTag,
1026  const String& musicBrainzReleaseGroupID);
1027  static void setMusicBrainzAlbumArtistIDRaw(
1028  MUSIC_INFO::CMusicInfoTag* infoTag, const std::vector<String>& musicBrainzAlbumArtistID);
1029  static void setCommentRaw(MUSIC_INFO::CMusicInfoTag* infoTag, const String& comment);
1030 #endif
1031  };
1033  }
1034 }
Defining LOG_LIFECYCLE_EVENTS will log all instantiations, deletions and also reference countings (in...
Definition: Addon.cpp:25
This class is the superclass for all reference counted classes in the api.
Definition: AddonClass.h:57
Definition: InfoTagMusic.h:47
Definition: MusicInfoTag.h:27
Definition: visualization.h:21
Definition: Application.h:79