wolffd@0: % --- wolffd@0: % This is the class for magnatagatune clips wolffd@0: % --- wolffd@0: wolffd@0: classdef MTTClip < Clip wolffd@0: wolffd@0: % --- wolffd@0: % here come the internal clip properties. wolffd@0: % the database is stored as a global variable wolffd@0: % --- wolffd@0: wolffd@0: % --- wolffd@0: % simple constructor wolffd@0: % --- wolffd@0: methods wolffd@0: function clip = MTTClip(varargin) wolffd@0: clip = clip@Clip(varargin{:},'db_MTTClip'); wolffd@0: end wolffd@0: wolffd@0: function out = mp3file(this) wolffd@0: % returns filename for given genre id wolffd@0: wolffd@0: out = this.my_db.clip_info_proper{this.my_dbpos,10}; wolffd@0: end wolffd@0: wolffd@0: wolffd@0: function filename = mp3file_full(this) wolffd@0: % returns mp3 filename for given clip id wolffd@0: wolffd@0: global globalvars; wolffd@0: filename = strcat(globalvars.tstaudiopath,this.mp3file()); wolffd@0: filename = strrep(filename,'\',globalvars.systemslash); wolffd@0: filename = strrep(filename,'/',globalvars.systemslash); wolffd@0: end wolffd@0: wolffd@0: function filename = featurefile_full(this) wolffd@0: % returns xml filename for given clip id wolffd@0: wolffd@0: % --- wolffd@0: % NOTE: the xml files are supposed to be in the folder wolffd@0: % "xml" as subfolder of the mp3 file path wolffd@0: % --- wolffd@0: global globalvars; wolffd@0: filename = strcat(globalvars.tstaudiopath,'xml\',... wolffd@0: this.mp3file,'.xml'); wolffd@0: wolffd@0: filename = strrep(filename,'/',globalvars.systemslash); wolffd@0: filename = strrep(filename,'\',globalvars.systemslash); wolffd@0: end wolffd@0: wolffd@0: wolffd@0: % caution. last.fm dbs take a clip wolffd@0: function [out, score, annotids] = fmtags(this) wolffd@0: wolffd@0: [out, score, annotids] = this.my_db.fmtagdb.annots(this); wolffd@0: end wolffd@0: wolffd@0: % caution. last.fm dbs take a clip wolffd@0: % TODO: revert this to general annotdb for compability wolffd@0: function [out, score] = fmtag_ids(this) wolffd@0: wolffd@0: [out, score] = this.my_db.fmtagdb.annotids_for_owner(this); wolffd@0: end wolffd@0: wolffd@0: function [out, score] = genre_ids(this) wolffd@0: % returns clip genre for given clip id wolffd@0: wolffd@0: [out, score] = this(1).my_db.genredb.annotids_for_owner([this.id]); wolffd@0: end wolffd@0: wolffd@0: function [out, score, annotids] = genres(this) wolffd@0: % returns name strings for given genre position ids wolffd@0: wolffd@0: [out, score, annotids] = this(1).my_db.genredb.annots([this.id]); wolffd@0: end wolffd@0: wolffd@0: function print(this) wolffd@0: % prints out the album info wolffd@0: wolffd@0: fprintf('clip %d: %s by %s,\n on %s \n',this.id, ... wolffd@0: this.title(), this.artist(), this.album()); wolffd@0: wolffd@0: v = strcat(this.genres(),', '); wolffd@0: fprintf(' genres: %s\n', strcat(v{:})); wolffd@0: wolffd@0: v = strcat(this.tags(),', '); wolffd@0: fprintf(' tags: %s\n', strcat(v{:})); wolffd@0: wolffd@0: v = strcat(this.fmtags(),', '); wolffd@0: fprintf(' last.fm tags: %s\n', strcat(v{:})); wolffd@0: wolffd@0: % if nargout == 0 wolffd@0: % fprintf(out) wolffd@0: % end wolffd@0: end wolffd@0: wolffd@0: end wolffd@0: end