From 5207bb36de3324d0e29f4cef42635d770adb79d7 Mon Sep 17 00:00:00 2001 From: casey Date: Sun, 1 May 2016 21:55:05 -0700 Subject: [PATCH] Removed UTF8 macro -- no longer used. --- src/contrib/taglib_plugin/TagReaderTaglib.cpp | 30 +++++++++---------- src/contrib/taglib_plugin/taglib_plugin.cpp | 6 ++-- src/contrib/waveout/WaveOut.cpp | 5 +++- src/contrib/waveout/waveout_plugin.cpp | 6 ++-- src/core/Common.cpp | 4 +-- src/core/GenericTrack.cpp | 2 +- src/core/Indexer.cpp | 20 ++++++------- src/core/IndexerTrack.cpp | 14 ++++----- src/core/Library/Base.cpp | 6 ++-- src/core/Library/Remote.cpp | 14 ++++----- src/core/LibraryFactory.cpp | 6 ++-- src/core/LibraryTrack.cpp | 8 ++--- src/core/NonLibraryTrackHelper.cpp | 2 +- src/core/PluginFactory.cpp | 4 +-- src/core/Preferences.cpp | 4 +-- src/core/Query/TrackMetadata.cpp | 4 +-- src/core/Server.cpp | 6 ++-- src/core/TrackFactory.cpp | 4 +-- src/core/config.h | 10 ------- src/core/filestreams/LocalFileStream.cpp | 2 +- src/core/server/Connection.cpp | 4 +-- src/square/ConsoleUI.cpp | 20 ++++++------- src/square/DummyAudioEventHandler.cpp | 4 +-- src/square/DummyAudioEventHandler.h | 24 +++++++-------- 24 files changed, 101 insertions(+), 108 deletions(-) diff --git a/src/contrib/taglib_plugin/TagReaderTaglib.cpp b/src/contrib/taglib_plugin/TagReaderTaglib.cpp index aa4c51327..110133a58 100644 --- a/src/contrib/taglib_plugin/TagReaderTaglib.cpp +++ b/src/contrib/taglib_plugin/TagReaderTaglib.cpp @@ -103,11 +103,11 @@ bool TagReaderTaglib::CanReadTag(const char *extension){ boost::algorithm::to_lower(ext); // Convert to lower case - if( ext.compare(UTF("mp3")) == 0 || - ext.compare(UTF("ogg")) == 0 || - ext.compare(UTF("flac")) == 0 || - ext.compare(UTF("ape")) == 0 || - ext.compare(UTF("mpc")) == 0 + if( ext.compare("mp3") == 0 || + ext.compare("ogg") == 0 || + ext.compare("flac") == 0 || + ext.compare("ape") == 0 || + ext.compare("mpc") == 0 ) { return true; } @@ -125,14 +125,14 @@ bool TagReaderTaglib::ReadTag(musik::core::ITrack *track){ string ext(extension); boost::algorithm::to_lower(ext); // Convert to lower case - if(ext==UTF("mp3")) + if(ext=="mp3") if(this->GetID3v2Tag(track)){ // Get the generic tag as well, just in case there is only a id3v1 tag. this->GetGenericTag(track); return true; } - if(ext==UTF("ogg")) + if(ext=="ogg") if(this->GetOGGTag(track)) return true; @@ -228,7 +228,7 @@ bool TagReaderTaglib::GetID3v2Tag(musik::core::ITrack *track){ std::vector splitTrack; if(!aAllTags["TRCK"].isEmpty()){ TagLib::wstring tempTrack = aAllTags["TRCK"].front()->toString().toWString(); - boost::algorithm::split(splitTrack,tempTrack,boost::algorithm::is_any_of(UTF("/"))); + boost::algorithm::split(splitTrack,tempTrack,boost::algorithm::is_any_of("/")); this->SetTagValue("track",splitTrack[0].c_str(),track); if(splitTrack.size()>1){ this->SetTagValue("totaltracks",splitTrack[1].c_str(),track); @@ -316,9 +316,9 @@ bool TagReaderTaglib::GetID3v2Tag(musik::core::ITrack *track){ if(description.empty()){ this->SetTagValue("comment",comment->toString(),track); - }else if(description.compare(UTF("MusicMatch_Mood")) == 0){ + }else if(description.compare("MusicMatch_Mood") == 0){ this->SetTagValue("mood",comment->toString(),track); - }else if(description.compare(UTF("MusicMatch_Preference")) == 0){ + }else if(description.compare("MusicMatch_Preference") == 0){ this->SetTagValue("textrating",comment->toString(),track); } } @@ -372,7 +372,7 @@ void TagReaderTaglib::SetTagValue(const char* key,const char* string,musik::core } void TagReaderTaglib::SetTagValue(const char* key,const int tagInt,musik::core::ITrack *track){ - string temp = boost::str(boost::format(UTF("%1%"))%tagInt); + string temp = boost::str(boost::format("%1%")%tagInt); track->SetValue(key,temp.c_str()); } @@ -411,7 +411,7 @@ void TagReaderTaglib::SetSlashSeparatedValues(const char* key,TagLib::String tag string value(tagString.begin(),tagString.end()); std::vector splitValues; - boost::algorithm::split(splitValues,value,boost::algorithm::is_any_of(UTF("/"))); + boost::algorithm::split(splitValues,value,boost::algorithm::is_any_of("/")); for(std::vector::iterator theValue=splitValues.begin();theValue!=splitValues.end();++theValue){ track->SetValue(key,theValue->c_str()); @@ -441,19 +441,19 @@ void TagReaderTaglib::SetSlashSeparatedValues(const char* key,const TagLib::ID3v void TagReaderTaglib::SetAudioProperties(TagLib::AudioProperties *audioProperties,musik::core::ITrack *track){ if(audioProperties){ - string duration = boost::str(boost::format(UTF("%1%"))%audioProperties->length()); + string duration = boost::str(boost::format("%1%")%audioProperties->length()); this->SetTagValue("duration",duration,track); int bitrate( audioProperties->bitrate() ); if(bitrate){ - string temp( boost::str(boost::format(UTF("%1%"))%bitrate ) ); + string temp( boost::str(boost::format("%1%")%bitrate ) ); this->SetTagValue("bitrate",temp,track); } int channels( audioProperties->channels() ); if(channels){ - string temp( boost::str(boost::format(UTF("%1%"))%channels ) ); + string temp( boost::str(boost::format("%1%")%channels ) ); this->SetTagValue("channels",temp,track); } } diff --git a/src/contrib/taglib_plugin/taglib_plugin.cpp b/src/contrib/taglib_plugin/taglib_plugin.cpp index b8cec49a1..3fc1bf23a 100644 --- a/src/contrib/taglib_plugin/taglib_plugin.cpp +++ b/src/contrib/taglib_plugin/taglib_plugin.cpp @@ -79,15 +79,15 @@ class TaglibPlugin : public musik::core::IPlugin void Destroy() { delete this; }; const char* Name(){ - return UTF("Taglib 1.5 plugin"); + return "Taglib 1.5 plugin"; }; const char* Version(){ - return UTF("0.1"); + return "0.1"; }; const char* Author(){ - return UTF("Daniel �nnerby"); + return "Daniel �nnerby"; }; }; diff --git a/src/contrib/waveout/WaveOut.cpp b/src/contrib/waveout/WaveOut.cpp index eef175783..4bc93a060 100644 --- a/src/contrib/waveout/WaveOut.cpp +++ b/src/contrib/waveout/WaveOut.cpp @@ -228,7 +228,10 @@ void WaveOut::SetFormat(IBuffer *buffer) { this->waveFormat.dwChannelMask = speakerConfig; this->waveFormat.SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; - /* create the output device */ + /* create the output device. note that we use a thread instead of a simple callback + here. that's because processing a buffer after calling waveOutReset() can lead to + crashes; so we can use a thread and ensure it's shut down before resetting the + output device, making it impossible to reach this condition. */ int openResult = waveOutOpen( &this->waveHandle, WAVE_MAPPER, diff --git a/src/contrib/waveout/waveout_plugin.cpp b/src/contrib/waveout/waveout_plugin.cpp index 4eacac9f1..30e2cb640 100644 --- a/src/contrib/waveout/waveout_plugin.cpp +++ b/src/contrib/waveout/waveout_plugin.cpp @@ -45,9 +45,9 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv class WaveOutPlugin : public musik::core::IPlugin { void Destroy() { delete this; }; - const char* Name() { return UTF("WaveOut output plugin"); }; - const char* Version() { return UTF("1"); }; - const char* Author() { return UTF("Bj�rn Olievier"); }; + const char* Name() { return "WaveOut output plugin"; }; + const char* Version() { return "1"; }; + const char* Author() { return "Bj�rn Olievier"; }; }; extern "C" __declspec(dllexport) musik::core::IPlugin* GetPlugin() { diff --git a/src/core/Common.cpp b/src/core/Common.cpp index 03ea8da08..d143bf993 100644 --- a/src/core/Common.cpp +++ b/src/core/Common.cpp @@ -51,7 +51,7 @@ ////////////////////////////////////////// std::string musik::core::GetPluginDirectory(){ std::string sDirectory(GetApplicationDirectory()); - sDirectory.append(UTF("plugins/")); + sDirectory.append("plugins/"); return sDirectory; } @@ -87,7 +87,7 @@ std::string musik::core::GetDataDirectory(){ delete [] sBuffer; #endif - directory.append(UTF("/mC2/")); + directory.append("/mC2/"); // Create folder if it does not exist boost::filesystem::path oFolder(directory); diff --git a/src/core/GenericTrack.cpp b/src/core/GenericTrack.cpp index 6e500bb7d..7255b9546 100644 --- a/src/core/GenericTrack.cpp +++ b/src/core/GenericTrack.cpp @@ -86,7 +86,7 @@ const char* GenericTrack::GetValue(const char* metakey){ if(metaKey=="title"){ // In case there is no title - std::string::size_type lastSlash = this->uri.find_last_of(UTF("/\\")); + std::string::size_type lastSlash = this->uri.find_last_of("/\\"); if(lastSlash!=std::string::npos){ static std::string tempString; tempString = this->uri.substr(lastSlash+1); diff --git a/src/core/Indexer.cpp b/src/core/Indexer.cpp index 7f35f9dfb..651d25de6 100644 --- a/src/core/Indexer.cpp +++ b/src/core/Indexer.cpp @@ -89,22 +89,22 @@ std::string Indexer::GetStatus(){ std::string sStatus; switch(this->status){ case 1: - sStatus = boost::str(boost::format(UTF("Counting files: %1%"))%this->nofFiles ); + sStatus = boost::str(boost::format("Counting files: %1%")%this->nofFiles ); break; case 2: - sStatus = boost::str(boost::format(UTF("Indexing: %.2f"))%(this->progress*100)) + UTF("%"); + sStatus = boost::str(boost::format("Indexing: %.2f") % (this->progress*100)) + "%"; break; case 3: - sStatus = boost::str(boost::format(UTF("Removing old files: %.2f"))%(this->progress*100)) + UTF("%"); + sStatus = boost::str(boost::format("Removing old files: %.2f") % (this->progress*100)) + "%"; break; case 4: - sStatus = UTF("Cleaning up."); + sStatus = "Cleaning up."; break; case 5: - sStatus = UTF("Optimizing."); + sStatus = "Optimizing."; break; case 6: - sStatus = boost::str(boost::format(UTF("Analyzing: %.2f%% (current %.1f%%)"))%(100.0*this->progress/(double)this->nofFiles)%(this->progress2*100.0)); + sStatus = boost::str(boost::format("Analyzing: %.2f%% (current %.1f%%)")%(100.0*this->progress/(double)this->nofFiles)%(this->progress2*100.0)); break; } return sStatus; @@ -148,8 +148,8 @@ bool Indexer::Restarted(){ void Indexer::AddPath(std::string sPath){ boost::filesystem::path oPath(sPath); sPath = oPath.string(); // Fix pathname for slash/backslash - if(sPath.substr(sPath.size()-1,1)!=UTF("/")){ - sPath += UTF("/"); + if(sPath.substr(sPath.size()-1,1)!="/"){ + sPath += "/"; } Indexer::_AddRemovePath addPath; @@ -457,7 +457,7 @@ void Indexer::SyncDirectory(std::string &sFolder,DBID iParentFolderId,DBID iPath } } catch(...){ -// std::wcout << UTF("ERROR ") << sFolder << std::endl; +// std::wcout << "ERROR " << sFolder << std::endl; } } @@ -534,7 +534,7 @@ bool Indexer::Startup(std::string setLibraryPath){ this->libraryPath = setLibraryPath; // Create thumbnail cache directory - boost::filesystem::path thumbPath(this->libraryPath+UTF("thumbs/")); + boost::filesystem::path thumbPath(this->libraryPath+"thumbs/"); if(!boost::filesystem::exists(thumbPath)){ boost::filesystem::create_directories(thumbPath); } diff --git a/src/core/IndexerTrack.cpp b/src/core/IndexerTrack.cpp index 9ef70e2a9..afe701a10 100644 --- a/src/core/IndexerTrack.cpp +++ b/src/core/IndexerTrack.cpp @@ -146,7 +146,7 @@ bool IndexerTrack::CompareDBAndFileInfo( this->SetValue("path", file.string().c_str()); this->SetValue("filename", file.leaf().string().c_str()); - size_t lastDot = file.leaf().string().find_last_of(UTF(".")); + size_t lastDot = file.leaf().string().find_last_of("."); if(lastDot != std::string::npos){ this->SetValue("extension",file.leaf().string().substr(lastDot+1).c_str()); } @@ -266,7 +266,7 @@ bool IndexerTrack::Save(db::Connection &dbConnection, std::string libraryDirecto // Second, add to the visual genre if(count!=0){ - visualGenres += UTF(", "); + visualGenres += ", "; } visualGenres += genres.first->second; @@ -300,7 +300,7 @@ bool IndexerTrack::Save(db::Connection &dbConnection, std::string libraryDirecto // Second, add to the visual artist if(count!=0){ - visualArtists += UTF(", "); + visualArtists += ", "; } visualArtists += artists.first->second; @@ -323,7 +323,7 @@ bool IndexerTrack::Save(db::Connection &dbConnection, std::string libraryDirecto db::CachedStatement stmt("SELECT id FROM albums WHERE name=?",dbConnection); const char *album=this->GetValue("album"); if(album==NULL){ - album=UTF(""); + album=""; } stmt.BindTextUTF(0,album); @@ -371,15 +371,15 @@ bool IndexerTrack::Save(db::Connection &dbConnection, std::string libraryDirecto // Save the file std::string filename = libraryDirectory + - UTF("thumbs/") + + "thumbs/" + boost::lexical_cast(thumbnailId) + - UTF(".jpg"); + ".jpg"; #ifdef WIN32 std::wstring wfilename = u8to16(filename); FILE *thumbFile = _wfopen(wfilename.c_str(), _T("wb")); #else - FILE *thumbFile = fopen(filename.c_str(),UTF("wb")); + FILE *thumbFile = fopen(filename.c_str(),"wb"); #endif fwrite(this->meta->thumbnailData,sizeof(char),this->meta->thumbnailSize,thumbFile); fclose(thumbFile); diff --git a/src/core/Library/Base.cpp b/src/core/Library/Base.cpp index e391dc9ef..8bd5875f3 100644 --- a/src/core/Library/Base.cpp +++ b/src/core/Library/Base.cpp @@ -135,7 +135,7 @@ std::string Library::Base::GetLibraryDirectory(){ std::string directory( musik::core::GetDataDirectory() ); if(!this->identifier.empty()){ - directory.append(this->identifier+UTF("/")); + directory.append(this->identifier+"/"); } boost::filesystem::path oFolder(directory); @@ -157,7 +157,7 @@ std::string Library::Base::GetLibraryDirectory(){ ////////////////////////////////////////// std::string Library::Base::GetDBPath(){ std::string sPath = this->GetLibraryDirectory(); - sPath.append(UTF("musik.db")); + sPath.append("musik.db"); return sPath; } @@ -733,7 +733,7 @@ void Library::Base::CreateDatabase(db::Connection &db){ ///get the HTTP-address to the tracks ////////////////////////////////////////// std::string Library::Base::BasePath(){ - return UTF(""); + return ""; } LibraryPtr Library::Base::GetSelfPtr(){ diff --git a/src/core/Library/Remote.cpp b/src/core/Library/Remote.cpp index cdd2d663e..8797499b0 100644 --- a/src/core/Library/Remote.cpp +++ b/src/core/Library/Remote.cpp @@ -97,7 +97,7 @@ Library::Remote::~Remote(void){ ///about the Indexer. ////////////////////////////////////////// std::string Library::Remote::GetInfo(){ - return UTF(""); + return ""; } @@ -129,10 +129,10 @@ void Library::Remote::ReadThread(){ { Preferences prefs("Connection",this->Name().c_str()); - this->address = prefs.GetString("address",UTF("localhost")); - this->port = prefs.GetString("port",UTF("10543")); - this->username = prefs.GetString("username",UTF("")); - this->password = prefs.GetString("password",UTF("")); + this->address = prefs.GetString("address","localhost"); + this->port = prefs.GetString("port","10543"); + this->username = prefs.GetString("username",""); + this->password = prefs.GetString("password",""); } boost::asio::ip::tcp::resolver resolver(this->ioService); @@ -341,12 +341,12 @@ void Library::Remote::Exit(){ ///get the HTTP-address to the tracks ////////////////////////////////////////// std::string Library::Remote::BasePath(){ - std:: string path(UTF("http://")); + std:: string path("http://"); boost::asio::ip::tcp::endpoint endPoint = this->socket.remote_endpoint(); boost::asio::ip::address address = endPoint.address(); path += address.to_string(); - path += UTF(":") + this->httpPort + UTF("/"); + path += ":" + this->httpPort + "/"; return path; } diff --git a/src/core/LibraryFactory.cpp b/src/core/LibraryFactory.cpp index ace95edae..39f0a7f20 100644 --- a/src/core/LibraryFactory.cpp +++ b/src/core/LibraryFactory.cpp @@ -59,7 +59,7 @@ LibraryFactory& LibraryFactory::Instance(){ LibraryFactory::LibraryFactory(void){ // Connect to the settings.db std::string dataDir = GetDataDirectory(); - std::string dbFile = GetDataDirectory() + UTF("settings.db"); + std::string dbFile = GetDataDirectory() + "settings.db"; musik::core::db::Connection db; db.Open(dbFile.c_str(),0,128); @@ -74,7 +74,7 @@ LibraryFactory::LibraryFactory(void){ // If there are no libraries, add a LocalDB if(this->libraries.empty()){ - this->CreateLibrary(UTF("Local Library"),LibraryFactory::LocalDB); + this->CreateLibrary("Local Library",LibraryFactory::LocalDB); } } @@ -156,7 +156,7 @@ void LibraryFactory::RemoveLibrary(std::string name){ LibraryPtr LibraryFactory::CreateLibrary(std::string name,int type,bool startup){ // Connect to the settings.db std::string dataDir = GetDataDirectory(); - std::string dbFile = GetDataDirectory() + UTF("settings.db"); + std::string dbFile = GetDataDirectory() + "settings.db"; musik::core::db::Connection db; db.Open(dbFile.c_str(),0,128); diff --git a/src/core/LibraryTrack.cpp b/src/core/LibraryTrack.cpp index 8b7e1e8d3..dc5caabd9 100644 --- a/src/core/LibraryTrack.cpp +++ b/src/core/LibraryTrack.cpp @@ -146,18 +146,18 @@ const char* LibraryTrack::URI(){ static std::string uri; if(this->meta){ uri = - UTF("mcdb://") + + "mcdb://" + this->meta->library->Identifier() + - UTF("/") + + "/" + boost::lexical_cast(this->id); return uri.c_str(); } else{ uri = - UTF("mcdb://") + + "mcdb://" + boost::lexical_cast(this->libraryId) + - UTF("/") + + "/" + boost::lexical_cast(this->id); return uri.c_str(); diff --git a/src/core/NonLibraryTrackHelper.cpp b/src/core/NonLibraryTrackHelper.cpp index 626f02678..f4ad89539 100644 --- a/src/core/NonLibraryTrackHelper.cpp +++ b/src/core/NonLibraryTrackHelper.cpp @@ -118,7 +118,7 @@ void NonLibraryTrackHelper::ThreadLoop(){ // check if this is a local file if(musik::core::io::Factory::IsLocalFileStream(track->URL())){ std::string url(track->URL()); - std::string::size_type lastDot = url.find_last_of(UTF(".")); + std::string::size_type lastDot = url.find_last_of("."); if(lastDot != std::string::npos){ track->SetValue("extension", url.substr(lastDot+1).c_str()); } diff --git a/src/core/PluginFactory.cpp b/src/core/PluginFactory.cpp index 977dabf83..64b77f6c8 100644 --- a/src/core/PluginFactory.cpp +++ b/src/core/PluginFactory.cpp @@ -89,7 +89,7 @@ void PluginFactory::LoadPlugins(){ std::string sFile(oFile->path().string()); #ifdef WIN32 - if(sFile.substr(sFile.size()-4)==UTF(".dll")){ // And a DLL + if(sFile.substr(sFile.size()-4)==".dll"){ // And a DLL std::wstring wpath = u8to16(sFile); HMODULE oDLL = LoadLibrary(wpath.c_str()); @@ -112,7 +112,7 @@ void PluginFactory::LoadPlugins(){ } #else //GNU or other - if(sFile.substr(sFile.size()-3)==UTF(".so")){ // And a shared lib + if(sFile.substr(sFile.size()-3)==".so"){ // And a shared lib void* oDLL = dlopen(sFile.c_str(), RTLD_NOW); char* err; if ((err = dlerror()) != NULL) { diff --git a/src/core/Preferences.cpp b/src/core/Preferences.cpp index 670fe58ad..8a269d782 100644 --- a/src/core/Preferences.cpp +++ b/src/core/Preferences.cpp @@ -123,7 +123,7 @@ Preferences::IO::Ptr Preferences::IO::Instance(){ Preferences::IO::IO(void){ boost::mutex::scoped_lock lock(this->mutex); std::string dataDir = GetDataDirectory(); - std::string dbFile = GetDataDirectory() + UTF("settings.db"); + std::string dbFile = GetDataDirectory() + "settings.db"; this->db.Open(dbFile.c_str(),0,128); Preferences::CreateDB(this->db); @@ -227,7 +227,7 @@ int Preferences::Setting::Value(int defaultValue){ std::string Preferences::Setting::Value(std::string defaultValue){ switch(this->type){ case Setting::Bool: - return this->valueBool?UTF("1"):UTF("0"); + return this->valueBool ? "1" : "0"; break; case Setting::Int: try{ diff --git a/src/core/Query/TrackMetadata.cpp b/src/core/Query/TrackMetadata.cpp index eb36249cf..fb9dd0b1c 100644 --- a/src/core/Query/TrackMetadata.cpp +++ b/src/core/Query/TrackMetadata.cpp @@ -434,9 +434,9 @@ bool TrackMetadata::SendResults(musik::core::xml::WriterNode &queryNode,Library: bool TrackMetadata::ReceiveResults(musik::core::xml::ParserNode &queryNode,Library::Base *library){ bool requestPath( this->requestedFields.find("path")!=this->requestedFields.end() ); - std::string pathPrefix(library->BasePath()+UTF("track/?auth_key=")); + std::string pathPrefix(library->BasePath()+"track/?auth_key="); pathPrefix += library->AuthorizationKey(); - pathPrefix += UTF("&track_id="); + pathPrefix += "&track_id="; while(musik::core::xml::ParserNode trackNode=queryNode.ChildNode("t") ){ try{ diff --git a/src/core/Server.cpp b/src/core/Server.cpp index 4c8a4cbd3..fdf82ace1 100644 --- a/src/core/Server.cpp +++ b/src/core/Server.cpp @@ -93,7 +93,7 @@ bool Server::Startup(){ } std::string Server::ServerIdentifier(){ - return UTF("server"); + return "server"; } @@ -102,8 +102,8 @@ void Server::ThreadLoop(){ musik::core::Preferences prefs("Server"); // Get directory and database paths - std::string directory( musik::core::GetDataDirectory()+this->ServerIdentifier()+UTF("/") ); - std::string database(directory+UTF("musik.db")); + std::string directory( musik::core::GetDataDirectory()+this->ServerIdentifier()+"/" ); + std::string database(directory+"musik.db"); // Create directory if not existing boost::filesystem::path folder(directory); diff --git a/src/core/TrackFactory.cpp b/src/core/TrackFactory.cpp index 16e2b64f3..e441e6c9f 100644 --- a/src/core/TrackFactory.cpp +++ b/src/core/TrackFactory.cpp @@ -43,8 +43,8 @@ using namespace musik::core; TrackPtr TrackFactory::CreateTrack(std::string uri){ - if(uri.substr(0,7)==UTF("mcdb://")){ - boost::regex reg(UTF("mcdb://([0-9]+)/([0-9]+)")); + if(uri.substr(0,7)=="mcdb://"){ + boost::regex reg("mcdb://([0-9]+)/([0-9]+)"); boost::smatch matches; if(boost::regex_match(uri,matches,reg)){ return TrackPtr(new LibraryTrack( diff --git a/src/core/config.h b/src/core/config.h index a2d74faa1..b7fcf5523 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -69,16 +69,6 @@ typedef UINT64 DBID; typedef UINT64 VERSION; typedef UINT64 DBTIME; -////////////////////////////////////////// -///\brief -///The UTF macro is the text macro when writing texts in the code that -///should be utf encoded. -/// -///\remarks -///We thought that the _T was a little bit too microsoft specific. -////////////////////////////////////////// -#define UTF(x) x - #ifdef WIN32 #define CopyFloat(dst, src, num) CopyMemory(dst, src, (num) * sizeof(float)) #else diff --git a/src/core/filestreams/LocalFileStream.cpp b/src/core/filestreams/LocalFileStream.cpp index 73a69f5b0..f0eeaeb6f 100644 --- a/src/core/filestreams/LocalFileStream.cpp +++ b/src/core/filestreams/LocalFileStream.cpp @@ -79,7 +79,7 @@ bool LocalFileStream::Open(const char *filename,unsigned int options){ this->filesize = (long)boost::filesystem::file_size(file); this->extension = file.extension().string(); - this->file = UTFFopen(filename,UTF("rb")); + this->file = UTFFopen(filename,"rb"); this->fd = new boost::iostreams::file_descriptor(file); this->fileStream = new boost::iostreams::stream(*this->fd); this->fileStream->exceptions(std::ios_base::eofbit | std::ios_base::failbit | std::ios_base::badbit); diff --git a/src/core/server/Connection.cpp b/src/core/server/Connection.cpp index b331651e1..6f6fd6920 100644 --- a/src/core/server/Connection.cpp +++ b/src/core/server/Connection.cpp @@ -59,7 +59,7 @@ using namespace musik::core::server; Connection::Connection(boost::asio::io_service &ioService,musik::core::Server *server) :socket(ioService) - ,Base(UTF("Server"),0) + ,Base("Server",0) ,server(server) ,salt(musik::core::Crypt::GenerateSalt()) { @@ -342,7 +342,7 @@ void Connection::CancelCurrentQuery( ){ } std::string Connection::GetInfo(){ - return UTF(""); + return ""; } void Connection::Exit(){ diff --git a/src/square/ConsoleUI.cpp b/src/square/ConsoleUI.cpp index e6f734978..93afe6e93 100644 --- a/src/square/ConsoleUI.cpp +++ b/src/square/ConsoleUI.cpp @@ -88,7 +88,7 @@ void ConsoleUI::Run() while (!this->shouldQuit) { this->PrintCommands(); - cout << UTF("Enter command: "); + cout << "Enter command: "; std::getline(cin, command); // Need getline to handle spaces! this->ProcessCommand(command); } @@ -114,38 +114,38 @@ void ConsoleUI::ProcessCommand(std::string commandString) boost::algorithm::split(args, commandString, boost::is_any_of(" ")); - std::string command = args.size() > 0 ? args[0] : UTF(""); + std::string command = args.size() > 0 ? args[0] : ""; args.erase(args.begin()); - if (command == UTF("p")) + if (command == "p") { this->PlayFile(args); } - else if (command == UTF("pa")) + else if (command == "pa") { this->Pause(); } - else if (command == UTF("s")) + else if (command == "s") { this->Stop(args); } - else if (command == UTF("seek")) + else if (command == "seek") { this->SetPosition(args); } - else if (command == UTF("l")) + else if (command == "l") { this->ListPlaying(); } - else if (command == UTF("lp")) + else if (command == "lp") { this->ListPlugins(); } - else if (command == UTF("v")) + else if (command == "v") { this->SetVolume(args); } - else if (command == UTF("q")) + else if (command == "q") { this->Quit(); } diff --git a/src/square/DummyAudioEventHandler.cpp b/src/square/DummyAudioEventHandler.cpp index 171772989..3716a4a80 100644 --- a/src/square/DummyAudioEventHandler.cpp +++ b/src/square/DummyAudioEventHandler.cpp @@ -50,11 +50,11 @@ DummyAudioEventHandler::~DummyAudioEventHandler() void DummyAudioEventHandler::PrintEvent(std::string s) { - this->cui->Print(UTF("EVENT: " + s + UTF("\n"))); + this->cui->Print("EVENT: " + s + "\n"); } void DummyAudioEventHandler::OnMixpointReached() { - this->PrintEvent(UTF("Mix point reached")); + this->PrintEvent("Mix point reached"); //this->cui->StartNew(); // Endless test loop } diff --git a/src/square/DummyAudioEventHandler.h b/src/square/DummyAudioEventHandler.h index d94b88e56..8c6770110 100644 --- a/src/square/DummyAudioEventHandler.h +++ b/src/square/DummyAudioEventHandler.h @@ -56,19 +56,19 @@ private: ConsoleUI* cui; // TODO: should probably be interface private: void PrintEvent(std::string s); // Slots -public: void OnPlaybackAlmostEnded() { this->PrintEvent(UTF("Playback almost done")); }; -public: void OnPlaybackStartedOk() { this->PrintEvent(UTF("Playback started OK")); }; -public: void OnPlaybackStartedFail() { this->PrintEvent(UTF("Playback started FAIL")); }; -public: void OnPlaybackStoppedOk() { this->PrintEvent(UTF("Playback stopped OK")); }; -public: void OnPlaybackStoppedFail() { this->PrintEvent(UTF("Playback stopped FAIL")); }; -public: void OnPlaybackInterrupted() { this->PrintEvent(UTF("Playback interrupted")); }; -public: void OnVolumeChangedOk() { this->PrintEvent(UTF("Volume changed OK")); }; -public: void OnVolumeChangedFail() { this->PrintEvent(UTF("Volume changed FAIL")); }; -public: void OnStreamOpenOk() { this->PrintEvent(UTF("Stream open OK")); }; -public: void OnStreamOpenFail() { this->PrintEvent(UTF("Stream open FAIL")); }; +public: void OnPlaybackAlmostEnded() { this->PrintEvent("Playback almost done"); }; +public: void OnPlaybackStartedOk() { this->PrintEvent("Playback started OK"); }; +public: void OnPlaybackStartedFail() { this->PrintEvent("Playback started FAIL"); }; +public: void OnPlaybackStoppedOk() { this->PrintEvent("Playback stopped OK"); }; +public: void OnPlaybackStoppedFail() { this->PrintEvent("Playback stopped FAIL"); }; +public: void OnPlaybackInterrupted() { this->PrintEvent("Playback interrupted"); }; +public: void OnVolumeChangedOk() { this->PrintEvent("Volume changed OK"); }; +public: void OnVolumeChangedFail() { this->PrintEvent("Volume changed FAIL"); }; +public: void OnStreamOpenOk() { this->PrintEvent("Stream open OK"); }; +public: void OnStreamOpenFail() { this->PrintEvent("Stream open FAIL"); }; public: void OnMixpointReached() ; -public: void OnSetPositionOk() { this->PrintEvent(UTF("Set position OK")); }; -public: void OnSetPositionFail() { this->PrintEvent(UTF("Set position FAIL")); }; +public: void OnSetPositionOk() { this->PrintEvent("Set position OK"); }; +public: void OnSetPositionFail() { this->PrintEvent("Set position FAIL"); }; }; }} // NS