1 /*
2  * tagging.cpp
3  * -----------
4  * Purpose: Structure holding a superset of tags for all supported output sample or stream files or types.
5  * Notes  : (currently none)
6  * Authors: OpenMPT Devs
7  * The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
8  */
9 
10 
11 #include "stdafx.h"
12 #include "Tagging.h"
13 #include "../common/version.h"
14 
15 OPENMPT_NAMESPACE_BEGIN
16 
17 
SetEncoder()18 void FileTags::SetEncoder()
19 {
20 	encoder = Version::Current().GetOpenMPTVersionString();
21 }
22 
23 
GetSampleNameFromTags(const FileTags & tags)24 mpt::ustring GetSampleNameFromTags(const FileTags &tags)
25 {
26 	mpt::ustring result;
27 	if(tags.artist.empty())
28 	{
29 		result = tags.title;
30 	} else
31 	{
32 		result = MPT_UFORMAT("{} (by {})")(tags.title, tags.artist);
33 	}
34 	return result;
35 }
36 
37 
38 OPENMPT_NAMESPACE_END
39