mirror of
https://github.com/clangen/musikcube.git
synced 2024-12-29 18:14:16 +00:00
- Made PluginFactory threadsafe.
- Fixed the splitting of the track number.
This commit is contained in:
parent
eb2d941042
commit
095ac9a4a8
@ -199,10 +199,12 @@ bool TagReaderTaglib::GetID3v2Tag(musik::core::Track *track){
|
||||
|
||||
// Split TRCK to track and totaltracks
|
||||
std::vector<utfstring> splitTrack;
|
||||
boost::algorithm::split(splitTrack,aAllTags["TRCK"].front()->toString().toWString(),boost::algorithm::is_any_of(_T("/")));
|
||||
this->SetTagValue("track",splitTrack[0].c_str(),track);
|
||||
if(splitTrack.size()>1){
|
||||
this->SetTagValue("totaltracks",splitTrack[1].c_str(),track);
|
||||
if(!aAllTags["TRCK"].isEmpty()){
|
||||
boost::algorithm::split(splitTrack,aAllTags["TRCK"].front()->toString().toWString(),boost::algorithm::is_any_of(_T("/")));
|
||||
this->SetTagValue("track",splitTrack[0].c_str(),track);
|
||||
if(splitTrack.size()>1){
|
||||
this->SetTagValue("totaltracks",splitTrack[1].c_str(),track);
|
||||
}
|
||||
}
|
||||
|
||||
this->SetTagValues("bpm",aAllTags["TBPM"],track);
|
||||
|
@ -66,6 +66,7 @@ PluginFactory::~PluginFactory(void){
|
||||
}
|
||||
|
||||
void PluginFactory::LoadPlugins(){
|
||||
boost::mutex::scoped_lock lock(this->mutex);
|
||||
utfstring sPluginDir(GetPluginDirectory());
|
||||
|
||||
// Open plugin directory
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/thread/mutex.hpp>
|
||||
|
||||
namespace musik{ namespace core{
|
||||
|
||||
@ -70,6 +71,8 @@ namespace musik{ namespace core{
|
||||
|
||||
static PluginFactory sInstance;
|
||||
|
||||
boost::mutex mutex;
|
||||
|
||||
public:
|
||||
|
||||
template <typename T>
|
||||
@ -86,6 +89,8 @@ namespace musik{ namespace core{
|
||||
};
|
||||
|
||||
template <class T, class D> std::vector<boost::shared_ptr<T>> QueryInterface(const char* functionName){
|
||||
boost::mutex::scoped_lock lock(this->mutex);
|
||||
|
||||
typedef T* (__stdcall* PluginInterfaceCall)();
|
||||
|
||||
std::vector<boost::shared_ptr<T>> plugins;
|
||||
|
Loading…
Reference in New Issue
Block a user