mirror of
				https://github.com/chibicitiberiu/rainmeter-studio.git
				synced 2024-02-24 04:33:31 +00:00 
			
		
		
		
	Fixed that the commands that start with "play" is not executed.
This commit is contained in:
		@@ -3299,29 +3299,29 @@ void CRainmeter::ExecuteCommand(const WCHAR* command, CMeterWindow* meterWindow)
 | 
			
		||||
				ExecuteBang(bang, arg, meterWindow);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		else if (_wcsnicmp(L"PLAY", command, 4) == 0)
 | 
			
		||||
		{
 | 
			
		||||
			command += 4;	// Skip PLAY
 | 
			
		||||
			if (_wcsnicmp(L"STOP", command, 4) == 0)
 | 
			
		||||
			{
 | 
			
		||||
				PlaySound(NULL, NULL, SND_PURGE);
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
		{
 | 
			
		||||
			// Check for built-ins
 | 
			
		||||
			if (_wcsnicmp(L"PLAY", command, 4) == 0)
 | 
			
		||||
			{
 | 
			
		||||
				if (command[4] == L' ' ||                      // PLAY
 | 
			
		||||
					_wcsnicmp(L"LOOP ", &command[4], 5) == 0)  // PLAYLOOP
 | 
			
		||||
				{
 | 
			
		||||
					command += 4;	// Skip PLAY
 | 
			
		||||
 | 
			
		||||
					DWORD flags = SND_FILENAME | SND_ASYNC;
 | 
			
		||||
 | 
			
		||||
				if (_wcsnicmp(L"LOOP", command, 4) == 0)
 | 
			
		||||
					if (command[0] != L' ')
 | 
			
		||||
					{
 | 
			
		||||
						flags |= SND_LOOP | SND_NODEFAULT;
 | 
			
		||||
						command += 4;	// Skip LOOP
 | 
			
		||||
					}
 | 
			
		||||
 | 
			
		||||
				if (command[0] == L' ')
 | 
			
		||||
					++command;	// Skip the space
 | 
			
		||||
					if (command[0] != L'\0')
 | 
			
		||||
					{
 | 
			
		||||
					command += 1;	// Skip the space
 | 
			
		||||
						strCommand = command;
 | 
			
		||||
					if (!strCommand.empty())
 | 
			
		||||
					{
 | 
			
		||||
 | 
			
		||||
						// Strip the quotes
 | 
			
		||||
						std::wstring::size_type len = strCommand.length();
 | 
			
		||||
						if (len >= 2 && strCommand[0] == L'\"' && strCommand[len - 1] == L'\"')
 | 
			
		||||
@@ -3332,11 +3332,16 @@ void CRainmeter::ExecuteCommand(const WCHAR* command, CMeterWindow* meterWindow)
 | 
			
		||||
 | 
			
		||||
						PlaySound(strCommand.c_str(), NULL, flags);
 | 
			
		||||
					}
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		else // Run command
 | 
			
		||||
				else if (_wcsnicmp(L"STOP", &command[4], 4) == 0)  // PLAYSTOP
 | 
			
		||||
				{
 | 
			
		||||
					PlaySound(NULL, NULL, SND_PURGE);
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			// Run command
 | 
			
		||||
			LSExecute(NULL, command, SW_SHOWNORMAL);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user