comparison core/magnatagatune/MTTClip.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 % ---
2 % This is the class for magnatagatune clips
3 % ---
4
5 classdef MTTClip < Clip
6
7 % ---
8 % here come the internal clip properties.
9 % the database is stored as a global variable
10 % ---
11
12 % ---
13 % simple constructor
14 % ---
15 methods
16 function clip = MTTClip(varargin)
17 clip = clip@Clip(varargin{:},'db_MTTClip');
18 end
19
20 function out = mp3file(this)
21 % returns filename for given genre id
22
23 out = this.my_db.clip_info_proper{this.my_dbpos,10};
24 end
25
26
27 function filename = mp3file_full(this)
28 % returns mp3 filename for given clip id
29
30 global globalvars;
31 filename = strcat(globalvars.tstaudiopath,this.mp3file());
32 filename = strrep(filename,'\',globalvars.systemslash);
33 filename = strrep(filename,'/',globalvars.systemslash);
34 end
35
36 function filename = featurefile_full(this)
37 % returns xml filename for given clip id
38
39 % ---
40 % NOTE: the xml files are supposed to be in the folder
41 % "xml" as subfolder of the mp3 file path
42 % ---
43 global globalvars;
44 filename = strcat(globalvars.tstaudiopath,'xml\',...
45 this.mp3file,'.xml');
46
47 filename = strrep(filename,'/',globalvars.systemslash);
48 filename = strrep(filename,'\',globalvars.systemslash);
49 end
50
51
52 % caution. last.fm dbs take a clip
53 function [out, score, annotids] = fmtags(this)
54
55 [out, score, annotids] = this.my_db.fmtagdb.annots(this);
56 end
57
58 % caution. last.fm dbs take a clip
59 % TODO: revert this to general annotdb for compability
60 function [out, score] = fmtag_ids(this)
61
62 [out, score] = this.my_db.fmtagdb.annotids_for_owner(this);
63 end
64
65 function [out, score] = genre_ids(this)
66 % returns clip genre for given clip id
67
68 [out, score] = this(1).my_db.genredb.annotids_for_owner([this.id]);
69 end
70
71 function [out, score, annotids] = genres(this)
72 % returns name strings for given genre position ids
73
74 [out, score, annotids] = this(1).my_db.genredb.annots([this.id]);
75 end
76
77 function print(this)
78 % prints out the album info
79
80 fprintf('clip %d: %s by %s,\n on %s \n',this.id, ...
81 this.title(), this.artist(), this.album());
82
83 v = strcat(this.genres(),', ');
84 fprintf(' genres: %s\n', strcat(v{:}));
85
86 v = strcat(this.tags(),', ');
87 fprintf(' tags: %s\n', strcat(v{:}));
88
89 v = strcat(this.fmtags(),', ');
90 fprintf(' last.fm tags: %s\n', strcat(v{:}));
91
92 % if nargout == 0
93 % fprintf(out)
94 % end
95 end
96
97 end
98 end