diff options
110 files changed, 351 insertions, 536 deletions
| diff --git a/include/delphi/m_helpers.inc b/include/delphi/m_helpers.inc index d5160da04c..f155f94866 100644 --- a/include/delphi/m_helpers.inc +++ b/include/delphi/m_helpers.inc @@ -33,9 +33,6 @@ function Langpack_Register:int_ptr;  function CreateProtoServiceFunction(const szModule, szService: PAnsiChar; serviceProc: TMIRANDASERVICE): int_ptr;
 -function SkinAddNewSound(const name, description, defaultFile: PAnsiChar): int_ptr;
 -function SkinPlaySound  (const name: PAnsiChar): int_ptr;
 -
  function Menu_AddContextFrameMenuItem(mi:PMO_MenuItem):HGENMENU;
  function Menu_AddMainMenuItem        (mi:PMO_MenuItem):HGENMENU;
  function Menu_AddContactMenuItem     (mi:PMO_MenuItem):HGENMENU;
 @@ -276,24 +273,6 @@ begin    Result := CreateServiceFunction(szStr, @serviceProc);
  end;
 -function SkinAddNewSound(const name, description, defaultFile: PAnsiChar): int_ptr;
 -var
 -  ssd: TSKINSOUNDDESCEX;
 -begin
 -  FillChar(ssd,SizeOf(ssd),0);
 -  ssd.cbSize         := sizeof(ssd);
 -  ssd.pszName        := name;
 -  ssd.pszDescription.a := description;
 -  ssd.pszDefaultFile.a := defaultFile;
 -  Result := CallService(MS_SKIN_ADDNEWSOUND, hLangpack, lParam(@ssd));
 -end;
 -
 -function SkinPlaySound (const name: PAnsiChar): int_ptr;
 -  {$IFDEF AllowInline}inline;{$ENDIF}
 -begin
 -  Result := CallService(MS_SKIN_PLAYSOUND, 0, lParam(name));
 -end;
 -
  function Menu_AddContextFrameMenuItem(mi:PMO_MenuItem):HGENMENU;
  begin
 diff --git a/include/delphi/m_skin.inc b/include/delphi/m_skin.inc index 5c07d87008..0aa6d537e9 100644 --- a/include/delphi/m_skin.inc +++ b/include/delphi/m_skin.inc @@ -115,19 +115,6 @@ function Skin_LoadProtoIcon(protoName:PAnsiChar; iconId:int; big:byte) : HICON;                   external AppDLL name 'Skin_LoadProtoIcon';
  const
 -  SSDF_UNICODE  = $0001;
 -type
 -  PSKINSOUNDDESCEX = ^TSKINSOUNDDESCEX;
 -  TSKINSOUNDDESCEX = record
 -    cbSize        : int;
 -    pszName       : PAnsiChar; // name to refer to sound when playing and in DB
 -    pszDescription: TChar; // [TRANSLATED-BY-CORE] description to use for it in options dialog
 -    pszDefaultFile: TChar; // the default sound file to use, WITHOUT path
 -    pszSection    : TChar; // [TRANSLATED-BY-CORE] section name used to group sounds (NULL is acceptable)
 -    dwFlags       : dword; // if Miranda ver >=9.0
 -  end;
 -
 -const
    {
      Affect : Load an icon from the user's custom skin lib, or from the exe
               if there isn't one loaded, see notes
 @@ -137,40 +124,6 @@ const    MS_SKIN_LOADICON:PAnsiChar = 'Skin/Icons/Load';
    {
 -    Affect : Load an icon representing the status_wanted for a particular protocol, see notes
 -    Returns: an HICON for the new icon, do NOT DestroyIcon() the return value
 -             returns NULL(0) on failure.
 -    Notes  : If wParam is NULL(0) the service will load the user's selected
 -             'all protocols' status icon
 -  }
 -
 -  {
 -    wParam : hLangpack
 -    lParam : Pointer to a initialised SKINSOUNDDESC
 -    Affect : Add a new sound so it has a default and can be changed in the
 -             options dialog
 -    Returns: 0 on success, [non zero] on failure
 -  }
 -  MS_SKIN_ADDNEWSOUND:PAnsiChar = 'Skin/Sounds/AddNew';
 -
 -  {
 -    wParam : 0
 -    lParam : Pointer to a null terminated string containing the name of the
 -             sound to play
 -    Affect : plays a named sound event, play name should of been added
 -             with MS_SKIN_ADDNEWSOUND,  see notes
 -    Notes  : function will not fail, it will play the Windows
 -  }
 -  MS_SKIN_PLAYSOUND:PAnsiChar = 'Skin/Sounds/Play';
 -
 -  {
 -    wParam = 0
 -    lParam = (WideChar *) ptszFileName
 -    Affect: plays any sound file
 -  }
 -  MS_SKIN_PLAYSOUNDFILE:PAnsiChar = 'Skin/Sounds/PlayFile';
 -
 -  {
      wParam : 0
      lParam : 0
      Affect : Sent when the icons DLL has been changed in the options dialog
 @@ -178,14 +131,4 @@ const    }
    ME_SKIN_ICONSCHANGED:PAnsiChar = 'Skin/IconsChanged';
 -  {
 -    wParam: 0 when playing sound (1 when sound is being previewed)
 -    lParam: (AnsiChar*) pszSoundFile
 -    Affect: This hook is fired when the sound module needs to play a sound
 -    Note  : This event has default processing, if no one HookEvent()'s this
 -        event then it will use the default hook code, which uses PlaySound()
 -    Version: 0.3.4a (2004/09/15)
 -  }
 -  ME_SKIN_PLAYINGSOUND:PAnsiChar = 'Skin/Sounds/Playing';
 -
  {$ENDIF}
 diff --git a/include/m_skin.h b/include/m_skin.h index 1d9f4d23a0..155b887ed6 100644 --- a/include/m_skin.h +++ b/include/m_skin.h @@ -117,84 +117,26 @@ EXTERN_C MIR_APP_DLL(char*)  Skin_GetIconName(int idx);  // returns NULL on failure
  // if szProto is NULL the function will load the user's selected 'all protocols'
  // status icon.
 +
  EXTERN_C MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big = false);
  /////////////////////////////////////////////////////////////////////////////////////////
 -// add a new sound so it has a default and can be changed in the options dialog
 -// wParam = hLangpack
 -// lParam = (LPARAM)(SKINSOUNDDESC*)ssd;
 +// adds a new sound so it has a default and can be changed in the options dialog
  // returns 0 on success, nonzero otherwise
 -#define SSDF_UNICODE 0x0001
 -
 -typedef struct {
 -	int cbSize;
 -	const char *pszName;           // name to refer to sound when playing and in db
 -	union {
 -		const char *pszDescription;    // [TRANSLATED-BY-CORE] description for options dialog
 -		const wchar_t *pwszDescription;
 -	};
 -	union {
 -		const char *pszDefaultFile;    // default sound file to use
 -		const wchar_t *pwszDefaultFile;
 -	};
 -	union {
 -		const char *pszSection;        // [TRANSLATED-BY-CORE] section name used to group sounds (NULL is acceptable)
 -		const wchar_t *pwszSection;
 -	};
 -	DWORD dwFlags;
 -}
 -	SKINSOUNDDESCEX;
 -
 -__forceinline INT_PTR SkinAddNewSoundEx(const char *name, const char *section, const char *description, const char *defaultFile = NULL)
 -{
 -	SKINSOUNDDESCEX ssd = { 0 };
 -	ssd.cbSize = sizeof(ssd);
 -	ssd.pszName = name;
 -	ssd.pszSection = section;
 -	ssd.pszDescription = description;
 -	ssd.pszDefaultFile = defaultFile;
 -	return CallService("Skin/Sounds/AddNew", hLangpack, (LPARAM)&ssd);
 -}
 -
 -__forceinline INT_PTR SkinAddNewSoundExW(const char *name, const wchar_t *section, const wchar_t *description, const wchar_t *defaultFile = NULL)
 -{
 -	SKINSOUNDDESCEX ssd = { 0 };
 -	ssd.cbSize = sizeof(ssd);
 -	ssd.dwFlags = SSDF_UNICODE;
 -	ssd.pszName = name;
 -	ssd.pwszSection = section;
 -	ssd.pwszDescription = description;
 -	ssd.pwszDefaultFile = defaultFile;
 -	return CallService("Skin/Sounds/AddNew", hLangpack, (LPARAM)&ssd);
 -}
 -
 -__forceinline INT_PTR Skin_AddSound(SKINSOUNDDESCEX *ssd)
 -{
 -	return CallService("Skin/Sounds/AddNew", hLangpack, (LPARAM)ssd);
 -}
 -
 -#define MS_SKIN_PLAYSOUND "Skin/Sounds/Play"
 +EXTERN_C MIR_APP_DLL(int) Skin_AddSound(const char *name, const wchar_t *section, const wchar_t *description, const wchar_t *defaultFile = nullptr, int = hLangpack);
  /////////////////////////////////////////////////////////////////////////////////////////
 -// plays a named sound event
 -// wParam = 0
 -// lParam = (LPARAM)(const char*)pszName
 -// pszName should have been added with Skin/Sounds/AddNew, but if not the
 -// function will not fail, it will play the Windows default sound instead.
 -__forceinline INT_PTR SkinPlaySound(const char *name) {
 -	return CallService(MS_SKIN_PLAYSOUND, 0, (LPARAM)name);
 -}
 +// plays a registered sound
 +// returns 0 on success, nonzero otherwise
 -#define MS_SKIN_PLAYSOUNDFILE "Skin/Sounds/PlayFile"
 +EXTERN_C MIR_APP_DLL(int) Skin_PlaySound(const char *name);
  /////////////////////////////////////////////////////////////////////////////////////////
 -// plays any sound file
 -// wParam = 0
 -// lParam = (LPARAM)(const wchar_t*)ptszFileName
 -__forceinline INT_PTR SkinPlaySoundFile(const wchar_t *ptszFileName) {
 -	return CallService(MS_SKIN_PLAYSOUNDFILE, 0, (LPARAM)ptszFileName);
 -}
 +// plays the sound file (non-registered)
 +// returns 0 on success, nonzero otherwise
 +
 +EXTERN_C MIR_APP_DLL(int) Skin_PlaySoundFile(const wchar_t *pwszFileName);
  /////////////////////////////////////////////////////////////////////////////////////////
 @@ -204,6 +146,7 @@ EXTERN_C MIR_APP_DLL(void) KillModuleSounds(int hLangpack);  // sent when the icons DLL has been changed in the options dialog, and everyone
  // should re-make their image lists
  // wParam = lParam = 0
 +
  #define ME_SKIN_ICONSCHANGED "Skin/IconsChanged"
  /////////////////////////////////////////////////////////////////////////////////////////
 @@ -212,6 +155,7 @@ EXTERN_C MIR_APP_DLL(void) KillModuleSounds(int hLangpack);  // Affect: This hook is fired when the sound module needs to play a sound
  // Note  : This event has default processing, if no one HookEvent()'s this event then it will
  //         use the default hook code, which uses PlaySound()
 +
  #define ME_SKIN_PLAYINGSOUND "Skin/Sounds/Playing"
  #endif //M_SKIN_H__
 diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.libBinary files differ index 09804a8423..a1bcf0c357 100644 --- a/libs/win32/mir_app.lib +++ b/libs/win32/mir_app.lib diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.libBinary files differ index 2fc95c40ef..9e45959bee 100644 --- a/libs/win64/mir_app.lib +++ b/libs/win64/mir_app.lib diff --git a/plugins/Alarms/src/alarm_win.cpp b/plugins/Alarms/src/alarm_win.cpp index d419884193..f00893fbc9 100644 --- a/plugins/Alarms/src/alarm_win.cpp +++ b/plugins/Alarms/src/alarm_win.cpp @@ -178,7 +178,7 @@ INT_PTR CALLBACK DlgProcAlarm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar  				if (data->sound_num <= 3) {
  					char buff[128];
  					mir_snprintf(buff, "Triggered%d", data->sound_num);
 -					SkinPlaySound(buff);
 +					Skin_PlaySound(buff);
  				}
  				else if (data->sound_num == 4) {
  					if (data->szTitle != NULL && data->szTitle[0] != '\0') {
 diff --git a/plugins/Alarms/src/alarmlist.cpp b/plugins/Alarms/src/alarmlist.cpp index 254e5119fd..a8c04b7d42 100755 --- a/plugins/Alarms/src/alarmlist.cpp +++ b/plugins/Alarms/src/alarmlist.cpp @@ -648,7 +648,7 @@ void DoAlarm(ALARM *alarm)  			if (alarm->sound_num > 0 && alarm->sound_num <= 3) {
  				char buff[128];
  				mir_snprintf(buff, "Triggered%d", alarm->sound_num);
 -				SkinPlaySound(buff);
 +				Skin_PlaySound(buff);
  			}
  			else if (alarm->sound_num == 4) {
  				if (alarm->szTitle != NULL && alarm->szTitle[0] != '\0') {
 @@ -779,9 +779,9 @@ int IdleChanged(WPARAM, LPARAM lParam)  void InitList()
  {
 -	SkinAddNewSoundEx("Triggered1", LPGEN("Alarms"), LPGEN("Alert 1"));
 -	SkinAddNewSoundEx("Triggered2", LPGEN("Alarms"), LPGEN("Alert 2"));
 -	SkinAddNewSoundEx("Triggered3", LPGEN("Alarms"), LPGEN("Alert 3"));
 +	Skin_AddSound("Triggered1", LPGENW("Alarms"), LPGENW("Alert 1"));
 +	Skin_AddSound("Triggered2", LPGENW("Alarms"), LPGENW("Alert 2"));
 +	Skin_AddSound("Triggered3", LPGENW("Alarms"), LPGENW("Alert 3"));
  	// load last checked time	
  	DBVARIANT dbv;
 diff --git a/plugins/AutoShutdown/src/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp index 553ec71f87..547efe82fa 100644 --- a/plugins/AutoShutdown/src/shutdownsvc.cpp +++ b/plugins/AutoShutdown/src/shutdownsvc.cpp @@ -328,7 +328,7 @@ static INT_PTR CALLBACK ShutdownDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L  			SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TEXT_HEADER), GWLP_USERDATA, countdown);
  			SendMessage(hwndDlg, M_UPDATE_COUNTDOWN, 0, countdown);
  		}
 -		SkinPlaySound("AutoShutdown_Countdown");
 +		Skin_PlaySound("AutoShutdown_Countdown");
  		if (!SetTimer(hwndDlg, 1, 1000, NULL))
  			PostMessage(hwndDlg, M_START_SHUTDOWN, 0, 0);
 @@ -375,7 +375,7 @@ static INT_PTR CALLBACK ShutdownDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L  			if (countdown == 27 || countdown == 24 || countdown == 21 || countdown == 19 ||
  				countdown == 17 || countdown == 15 || countdown == 13 || countdown == 11 ||
  				countdown <= 10)
 -				SkinPlaySound("AutoShutdown_Countdown");
 +				Skin_PlaySound("AutoShutdown_Countdown");
  		}
  		else KillTimer(hwndDlg, wParam);  /* countdown finished */
  		PostMessage(hwndDlg, M_UPDATE_COUNTDOWN, 0, countdown);
 @@ -496,7 +496,7 @@ void InitShutdownSvc(void)  {
  	/* Shutdown Dialog */
  	hwndShutdownDlg = NULL;
 -	SkinAddNewSoundExW("AutoShutdown_Countdown", LPGENW("Alerts"), LPGENW("Automatic shutdown countdown"));
 +	Skin_AddSound("AutoShutdown_Countdown", LPGENW("Alerts"), LPGENW("Automatic shutdown countdown"));
  	/* Events */
  	hEventOkToShutdown = CreateHookableEvent(ME_AUTOSHUTDOWN_OKTOSHUTDOWN);
 diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp index 061060f306..0cc29ece82 100644 --- a/plugins/AvatarHistory/src/AvatarHistory.cpp +++ b/plugins/AvatarHistory/src/AvatarHistory.cpp @@ -127,7 +127,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam)  			db_free(&dbvOldHash);
  			return 0;
  		}
 -		SkinPlaySound("avatar_removed");
 +		Skin_PlaySound("avatar_removed");
  		// Is a flash avatar or avs could not load it
  		db_set_ws(hContact, MODULE_NAME, "AvatarHash", L"-");
 @@ -142,7 +142,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam)  			db_free(&dbvOldHash);
  			return 0;
  		}
 -		SkinPlaySound("avatar_changed");
 +		Skin_PlaySound("avatar_changed");
  		db_set_ws(hContact, "AvatarHistory", "AvatarHash", avatar->hash);
  		wchar_t history_filename[MAX_PATH] = L"";
 @@ -343,8 +343,8 @@ extern "C" __declspec(dllexport) int Load(void)  	Profile_GetPathW(MAX_PATH, profilePath);
 -	SkinAddNewSoundExW("avatar_changed", LPGENW("Avatar history"), LPGENW("Contact changed avatar"));
 -	SkinAddNewSoundExW("avatar_removed", LPGENW("Avatar history"), LPGENW("Contact removed avatar"));
 +	Skin_AddSound("avatar_changed", LPGENW("Avatar history"), LPGENW("Contact changed avatar"));
 +	Skin_AddSound("avatar_removed", LPGENW("Avatar history"), LPGENW("Contact removed avatar"));
  	hAvatarWindowsList = WindowList_Create();
 diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp index 5c770678b0..2630ff4e68 100644 --- a/plugins/BASS_interface/src/Main.cpp +++ b/plugins/BASS_interface/src/Main.cpp @@ -215,7 +215,7 @@ INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara  				SendMessage(hwndSlider, TBM_SETPOS, TRUE, Volume);
  				Preview = TRUE;
  				if (EnPreview)
 -					SkinPlaySound("AlertMsg");
 +					Skin_PlaySound("AlertMsg");
  				SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
  			}
  		break;
 @@ -391,7 +391,7 @@ static LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR  				SendMessage(hwndOptSlider, TBM_SETPOS, TRUE, Volume);
  				Preview = TRUE;
  				if (EnPreview)
 -					SkinPlaySound("AlertMsg");
 +					Skin_PlaySound("AlertMsg");
  			}
  		break;
 diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index 83b36d2630..2b1b4ce00b 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -247,7 +247,7 @@ bool isContactGoneFor(MCONTACT hContact, int days)  				CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&ppd, APF_NEWDATA);
 -				SkinPlaySound("buddyExpectatorHide");
 +				Skin_PlaySound("buddyExpectatorHide");
  			}
  	return (daysSinceOnline >= days && (daysSinceMessage == -1 || daysSinceMessage >= days));
 @@ -258,7 +258,7 @@ void ReturnNotify(MCONTACT hContact, wchar_t *message)  	if (db_get_b(hContact, "CList", "NotOnList", 0) == 1 || db_get_b(hContact, "CList", "Hidden", 0) == 1)
  		return;
 -	SkinPlaySound("buddyExpectatorReturn");
 +	Skin_PlaySound("buddyExpectatorReturn");
  	if (options.iShowPopup > 0) {
  		// Display Popup
 @@ -501,7 +501,7 @@ int SettingChanged(WPARAM hContact, LPARAM lParam)  			CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&ppd, APF_NEWDATA);
 -			SkinPlaySound("buddyExpectatorMissYou");
 +			Skin_PlaySound("buddyExpectatorMissYou");
  		}
  	}
 @@ -549,7 +549,7 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD)  		if (proto && (db_get_b(hContact, proto, "ChatRoom", 0) == 0) && (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND) && isContactGoneFor(hContact, options.iAbsencePeriod2) && (db_get_b(hContact, MODULE_NAME, "StillAbsentNotified", 0) == 0))
  		{
  			db_set_b(hContact, MODULE_NAME, "StillAbsentNotified", 1);
 -			SkinPlaySound("buddyExpectatorStillAbsent");
 +			Skin_PlaySound("buddyExpectatorStillAbsent");
  			wchar_t* message = TranslateT("has not returned after a long absence.");
  			time_t tmpTime;
 @@ -593,10 +593,10 @@ int ModulesLoaded(WPARAM, LPARAM)  	HookEvent(ME_USERINFO_INITIALISE, UserinfoInit);
  	// add sounds support
 -	SkinAddNewSoundExW("buddyExpectatorReturn", LPGENW("BuddyExpectator"), LPGENW("Contact returned"));
 -	SkinAddNewSoundExW("buddyExpectatorStillAbsent", LPGENW("BuddyExpectator"), LPGENW("Contact still absent"));
 -	SkinAddNewSoundExW("buddyExpectatorMissYou", LPGENW("BuddyExpectator"), LPGENW("Miss you event"));
 -	SkinAddNewSoundExW("buddyExpectatorHide", LPGENW("BuddyExpectator"), LPGENW("Hide contact event"));
 +	Skin_AddSound("buddyExpectatorReturn", LPGENW("BuddyExpectator"), LPGENW("Contact returned"));
 +	Skin_AddSound("buddyExpectatorStillAbsent", LPGENW("BuddyExpectator"), LPGENW("Contact still absent"));
 +	Skin_AddSound("buddyExpectatorMissYou", LPGENW("BuddyExpectator"), LPGENW("Miss you event"));
 +	Skin_AddSound("buddyExpectatorHide", LPGENW("BuddyExpectator"), LPGENW("Hide contact event"));
  	timer_id = SetTimer(0, 0, 1000 * 60 * 60 * 4, TimerProc); // check every 4 hours
 diff --git a/plugins/ChangeKeyboardLayout/src/hook_events.cpp b/plugins/ChangeKeyboardLayout/src/hook_events.cpp index 4fb45f049e..6f1451a5bb 100644 --- a/plugins/ChangeKeyboardLayout/src/hook_events.cpp +++ b/plugins/ChangeKeyboardLayout/src/hook_events.cpp @@ -122,8 +122,8 @@ int ModulesLoaded(WPARAM, LPARAM)  	ReadPopupOptions();
  	// Çàðåãèì çâóê
 -	SkinAddNewSoundEx(SND_ChangeLayout, ModuleName, LPGEN("Changing Layout"));
 -	SkinAddNewSoundEx(SND_ChangeCase, ModuleName, LPGEN("Changing Case"));
 +	Skin_AddSound(SND_ChangeLayout, ModuleNameW, LPGENW("Changing Layout"));
 +	Skin_AddSound(SND_ChangeCase,   ModuleNameW, LPGENW("Changing Case"));
  	// Õóê íà íàæàòèå êëàâèøè
  	kbHook_All = SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC)Keyboard_Hook, NULL, GetCurrentThreadId());
 diff --git a/plugins/ChangeKeyboardLayout/src/stdafx.h b/plugins/ChangeKeyboardLayout/src/stdafx.h index 6eb9e0fadf..b1a3bac5f5 100644 --- a/plugins/ChangeKeyboardLayout/src/stdafx.h +++ b/plugins/ChangeKeyboardLayout/src/stdafx.h @@ -26,7 +26,8 @@  #include "version.h"
  #define MaxTextSize 64000
 -#define ModuleName LPGEN("ChangeKeyboardLayout")
 +#define ModuleName  LPGEN("ChangeKeyboardLayout")
 +#define ModuleNameW LPGENW("ChangeKeyboardLayout")
  // History++ API
  #define MS_HPP_EG_WINDOW			"History++/ExtGrid/NewWindow"
 diff --git a/plugins/ChangeKeyboardLayout/src/text_operations.cpp b/plugins/ChangeKeyboardLayout/src/text_operations.cpp index c8c44b1042..7df6916a89 100644 --- a/plugins/ChangeKeyboardLayout/src/text_operations.cpp +++ b/plugins/ChangeKeyboardLayout/src/text_operations.cpp @@ -436,9 +436,9 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord)  		}
  		if (TextOperation == TOT_Layout)
 -			SkinPlaySound(SND_ChangeLayout);
 +			Skin_PlaySound(SND_ChangeLayout);
  		else if (TextOperation == TOT_Case)
 -			SkinPlaySound(SND_ChangeCase);
 +			Skin_PlaySound(SND_ChangeCase);
  		if (moOptions.CopyToClipboard)
  			CopyTextToClipboard(ptszMBox);
 @@ -540,9 +540,9 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord)  		InvalidateRect(hTextWnd, NULL, FALSE);
  		if (TextOperation == TOT_Layout)
 -			SkinPlaySound(SND_ChangeLayout);
 +			Skin_PlaySound(SND_ChangeLayout);
  		else if (TextOperation == TOT_Case)
 -			SkinPlaySound(SND_ChangeCase);
 +			Skin_PlaySound(SND_ChangeCase);
  	}
  	return 0;
 diff --git a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp index 30f6df1406..cca57b1975 100644 --- a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp +++ b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp @@ -250,7 +250,7 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam)  		}
  		if (PerContactSetting == NOTIFY_ALWAYS || (PopupOptPage.GetValue(IDC_POPUPOPTDLG_POPUPNOTIFY) && (g_PreviewOptPage || PerContactSetting == NOTIFY_ALMOST_ALWAYS || -1 == PcreCheck(sd.MirVer)))) {
  			ShowPopup(&sd);
 -			SkinPlaySound(CLIENTCHANGED_SOUND);
 +			Skin_PlaySound(CLIENTCHANGED_SOUND);
  		}
  	}
 @@ -322,7 +322,8 @@ int MirandaLoaded(WPARAM, LPARAM)  	HookEvent(ME_SYSTEM_MODULELOAD, ModuleLoad);
  	HookEvent(ME_SYSTEM_MODULEUNLOAD, ModuleLoad);
  	HookEvent(ME_DB_CONTACT_SETTINGCHANGED, ContactSettingChanged);
 -	SkinAddNewSoundEx(CLIENTCHANGED_SOUND, NULL, LPGEN("ClientChangeNotify: Client changed"));
 +
 +	Skin_AddSound(CLIENTCHANGED_SOUND, nullptr, LPGENW("ClientChangeNotify: Client changed"));
  	if (bPopupExists) {
  		CreateServiceFunction(MS_CCN_TOGGLEPOPUPS, srvTogglePopups);
 diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp index 9bec312628..fe7a0d9aa1 100644 --- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp +++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp @@ -707,7 +707,7 @@ static unsigned __stdcall checkthread(void *)  				if (WAIT_OBJECT_0 == WaitForSingleObject(hExceptionsMutex, 100)) {
  					if (checkFilter(connExceptions, cur)) {
  						showMsg(cur->PName, cur->Pid, cur->strIntIp, cur->strExtIp, cur->intIntPort, cur->intExtPort, cur->state);
 -						SkinPlaySound(PLUGINNAME_NEWSOUND);
 +						Skin_PlaySound(PLUGINNAME_NEWSOUND);
  					}
  					ReleaseMutex(hExceptionsMutex);
  				}
 @@ -876,7 +876,7 @@ extern "C" int __declspec(dllexport) Load(void)  	CreateProtoServiceFunction(PLUGINNAME, PS_SETSTATUS, SetStatus);
  	CreateProtoServiceFunction(PLUGINNAME, PS_GETSTATUS, GetStatus);
 -	SkinAddNewSoundEx(PLUGINNAME_NEWSOUND, PLUGINNAME, LPGEN("New Connection Notification"));
 +	Skin_AddSound(PLUGINNAME_NEWSOUND, PLUGINNAMEW, LPGENW("New Connection Notification"));
  	hOptInit = HookEvent(ME_OPT_INITIALISE, ConnectionNotifyOptInit);//register service to hook option call
  	assert(hOptInit);
  	hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, modulesloaded);//hook event that all plugins are loaded
 diff --git a/plugins/ConnectionNotify/src/stdafx.h b/plugins/ConnectionNotify/src/stdafx.h index 4e7f512ad0..f14056ff09 100644 --- a/plugins/ConnectionNotify/src/stdafx.h +++ b/plugins/ConnectionNotify/src/stdafx.h @@ -26,6 +26,7 @@  #define MAX_SETTING_STR 512
  #define PLUGINNAME "ConnectionNotify"
 +#define PLUGINNAMEW L"ConnectionNotify"
  #define MAX_LENGTH 512
  #define STATUS_COUNT 9
 diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp index 23500aa6f3..5e3289a06a 100644 --- a/plugins/ContactsPlus/src/main.cpp +++ b/plugins/ContactsPlus/src/main.cpp @@ -70,7 +70,7 @@ static int HookDBEventAdded(WPARAM hContact, LPARAM hDbEvent)  		dbe.pBlob = (PBYTE)_alloca(dbe.cbBlob);
  	db_event_get(hDbEvent, &dbe);
  	//play received sound
 -	SkinPlaySound("RecvContacts");
 +	Skin_PlaySound("RecvContacts");
  	{
  		//add event to the contact list
  		wchar_t caToolTip[128];
 @@ -219,8 +219,8 @@ extern "C" __declspec(dllexport) int Load(void)  	CreateServiceFunction(MS_CONTACTS_RECEIVE, ServiceReceiveCommand);
  	//define event sounds
 -	SkinAddNewSoundEx("RecvContacts", LPGEN("Events"), LPGEN("Incoming Contacts"), "contacts.wav");
 -	SkinAddNewSoundEx("SentContacts", LPGEN("Events"), LPGEN("Outgoing Contacts"), "ocontacts.wav");
 +	Skin_AddSound("RecvContacts", LPGENW("Events"), LPGENW("Incoming Contacts"), L"contacts.wav");
 +	Skin_AddSound("SentContacts", LPGENW("Events"), LPGENW("Outgoing Contacts"), L"ocontacts.wav");
  	return 0;
  }
 diff --git a/plugins/ContactsPlus/src/send.cpp b/plugins/ContactsPlus/src/send.cpp index cb2318aa17..1016a386dc 100644 --- a/plugins/ContactsPlus/src/send.cpp +++ b/plugins/ContactsPlus/src/send.cpp @@ -431,7 +431,7 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara  			}
  			delete ackData; // all done, release structure
  			if (!wndData->uacklist.Count) {
 -				SkinPlaySound("SentContacts");
 +				Skin_PlaySound("SentContacts");
  				KillTimer(hwndDlg, TIMERID_MSGSEND);
  				if (wndData->hError)
 diff --git a/plugins/FTPFileYM/src/dialog.cpp b/plugins/FTPFileYM/src/dialog.cpp index 0735bedc22..9fbc7b8b57 100644 --- a/plugins/FTPFileYM/src/dialog.cpp +++ b/plugins/FTPFileYM/src/dialog.cpp @@ -395,7 +395,7 @@ INT_PTR CALLBACK UploadDialog::UploadDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar  				result = Utils::msgBox(TranslateT("Do you really want to cancel all running jobs?"), MB_YESNO | MB_ICONQUESTION);
  			if (result == IDYES) {
 -				SkinPlaySound(SOUND_CANCEL);
 +				Skin_PlaySound(SOUND_CANCEL);
  				size_t count = uDlg->m_tabs.size();
  				for (UINT i = 0; i < count; i++)
  					uDlg->m_tabs[0]->m_job->closeAllTabs();
 diff --git a/plugins/FTPFileYM/src/ftpfile.cpp b/plugins/FTPFileYM/src/ftpfile.cpp index 91de6e0066..ae85f49aa6 100644 --- a/plugins/FTPFileYM/src/ftpfile.cpp +++ b/plugins/FTPFileYM/src/ftpfile.cpp @@ -353,8 +353,8 @@ int ModulesLoaded(WPARAM, LPARAM)  	InitMenuItems();
  	InitTabsrmmButton();
 -	SkinAddNewSoundEx(SOUND_UPCOMPLETE, LPGEN("FTP File"), LPGEN("File upload complete"));
 -	SkinAddNewSoundEx(SOUND_CANCEL, LPGEN("FTP File"), LPGEN("Upload canceled"));
 +	Skin_AddSound(SOUND_UPCOMPLETE, LPGENW("FTP File"), LPGENW("File upload complete"));
 +	Skin_AddSound(SOUND_CANCEL, LPGENW("FTP File"), LPGENW("Upload canceled"));
  	curl_global_init(CURL_GLOBAL_ALL);
 diff --git a/plugins/FTPFileYM/src/job_upload.cpp b/plugins/FTPFileYM/src/job_upload.cpp index e80e5ed9f5..a519e897c4 100644 --- a/plugins/FTPFileYM/src/job_upload.cpp +++ b/plugins/FTPFileYM/src/job_upload.cpp @@ -339,7 +339,7 @@ void UploadJob::upload()  		}
  		DBEntry::add(this);
 -		SkinPlaySound(SOUND_UPCOMPLETE);
 +		Skin_PlaySound(SOUND_UPCOMPLETE);
  	}
  	setStatus(STATUS_COMPLETED);
 diff --git a/plugins/FileAsMessage/src/dialog.cpp b/plugins/FileAsMessage/src/dialog.cpp index ac13c114d1..dfb4a1c644 100644 --- a/plugins/FileAsMessage/src/dialog.cpp +++ b/plugins/FileAsMessage/src/dialog.cpp @@ -450,7 +450,7 @@ void FILEECHO::incomeRequest(char *param)  	setState(STATE_PRERECV);
  	inSend = FALSE;
 -	SkinPlaySound("RecvFile");
 +	Skin_PlaySound("RecvFile");
  	int AutoMin = db_get_b(NULL, "SRFile", "AutoMin", 0);
  	if (db_get_b(NULL, "SRFile", "AutoAccept", 0) && !db_get_b(hContact, "CList", "NotOnList", 0))
  	{
 @@ -548,7 +548,7 @@ void FILEECHO::onRecvTimer()  			PostMessage(hDlg, WM_CLOSE, 0, 0);
  			pcli->pfnRemoveEvent(hContact, 0);
  		}
 -		SkinPlaySound("FileDone");
 +		Skin_PlaySound("FileDone");
  		destroyTransfer();
  		buffer[0] = 'x'; buffer[1] = 0;
  	}
 @@ -719,7 +719,7 @@ void FILEECHO::cmdDACK(char *param)  		char *msg = Translate("Sent successfully");
  		SetDlgItemText(hDlg, IDC_STATUS, msg);
 -		SkinPlaySound("FileDone");
 +		Skin_PlaySound("FileDone");
  		destroyTransfer();
  		MakePopupMsg(hDlg, hContact, msg);
  		setState(STATE_FINISHED);
 diff --git a/plugins/GmailNotifier/src/main.cpp b/plugins/GmailNotifier/src/main.cpp index dabac93804..d2912d2082 100644 --- a/plugins/GmailNotifier/src/main.cpp +++ b/plugins/GmailNotifier/src/main.cpp @@ -91,7 +91,7 @@ extern "C" int __declspec(dllexport) Load()  	mir_getLP(&pluginInfoEx);
  	pcli = Clist_GetInterface();
 -	SkinAddNewSoundEx("Gmail", LPGEN("Other"), LPGEN("Gmail: New thread(s)"));
 +	Skin_AddSound("Gmail", LPGENW("Other"), LPGENW("Gmail: New thread(s)"));
  	HookEvent(ME_CLIST_DOUBLECLICKED, OpenBrowser);
  	PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE };
 diff --git a/plugins/GmailNotifier/src/notify.cpp b/plugins/GmailNotifier/src/notify.cpp index eb99a41ec4..7e90749477 100644 --- a/plugins/GmailNotifier/src/notify.cpp +++ b/plugins/GmailNotifier/src/notify.cpp @@ -120,7 +120,7 @@ void NotifyUser(Account *curAcc)  			PUAddPopup(&ppd);
  		}
  		if (newMails > 0)
 -			SkinPlaySound("Gmail");
 +			Skin_PlaySound("Gmail");
  	}
  	curAcc->oldResults_num = curAcc->results_num;
  	DeleteResults(curAcc->results.next);
 diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp index 90a1d3fe59..6e55f2a8e3 100644 --- a/plugins/LotusNotify/src/LotusNotify.cpp +++ b/plugins/LotusNotify/src/LotusNotify.cpp @@ -790,7 +790,7 @@ void checkthread(void*)  			log(L"checkthread: filters checked - positive");
  			///TODO eliminate popups with blank fields
  			showMsg(msgFrom, msgSubject, noteID, strLink);
 -			SkinPlaySound("LotusNotify");
 +			Skin_PlaySound("LotusNotify");
  		}
  		else {
  			log(L"checkthread: filters checked - negative");
 @@ -1728,7 +1728,7 @@ extern "C" int __declspec(dllexport) Load(void)  	LoadSettings(); //read from db to variables
 -	SkinAddNewSoundExW("LotusNotify", LPGENW("Lotus Notify"), LPGENW("New Lotus document detected"));
 +	Skin_AddSound("LotusNotify", LPGENW("Lotus Notify"), LPGENW("New Lotus document detected"));
  	hOptInit = HookEvent(ME_OPT_INITIALISE, LotusNotifyOptInit); //register service to hook option call
  	assert(hOptInit);
 diff --git a/plugins/MirLua/src/m_sounds.cpp b/plugins/MirLua/src/m_sounds.cpp index ea7c2a5e6a..b7e86b4c91 100644 --- a/plugins/MirLua/src/m_sounds.cpp +++ b/plugins/MirLua/src/m_sounds.cpp @@ -7,16 +7,7 @@ static int sounds_AddSound(lua_State *L)  	ptrW section(mir_utf8decodeW(luaL_optstring(L, 3, MODULE)));
  	ptrW filePath(mir_utf8decodeW(lua_tostring(L, 4)));
 -	SKINSOUNDDESCEX ssd = { sizeof(SKINSOUNDDESCEX) };
 -	ssd.pszName = name;
 -	ssd.dwFlags = SSDF_UNICODE;
 -	ssd.pwszDescription = description;
 -	ssd.pwszSection = section;
 -	ssd.pwszDefaultFile = filePath;
 -
 -	int hScriptLangpack = CMLuaScript::GetScriptIdFromEnviroment(L);
 -
 -	INT_PTR res = CallService("Skin/Sounds/AddNew", hScriptLangpack, (LPARAM)&ssd);
 +	int res = Skin_AddSound(name, section, description, filePath, CMLuaScript::GetScriptIdFromEnviroment(L));
  	lua_pushboolean(L, res == 0);
  	return 1;
 @@ -26,7 +17,7 @@ static int sounds_PlaySound(lua_State *L)  {
  	const char *name = luaL_checkstring(L, 1);
 -	INT_PTR res = SkinPlaySound(name);
 +	INT_PTR res = Skin_PlaySound(name);
  	lua_pushboolean(L, res == 0);
  	return 1;
 @@ -36,7 +27,7 @@ static int sounds_PlayFile(lua_State *L)  {
  	ptrW filePath(mir_utf8decodeW(luaL_checkstring(L, 1)));
 -	INT_PTR res = SkinPlaySoundFile(filePath);
 +	INT_PTR res = Skin_PlaySoundFile(filePath);
  	lua_pushboolean(L, res == 0);
  	return 1;
 diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp index f1e0e4794c..efe43115c4 100644 --- a/plugins/NewAwaySysMod/src/AwaySys.cpp +++ b/plugins/NewAwaySysMod/src/AwaySys.cpp @@ -687,7 +687,7 @@ int MirandaLoaded(WPARAM, LPARAM)  	// we have to read the status message from contacts too... err
  	CreateServiceFunction(MS_AWAYMSG_SHOWAWAYMSG, GetContactStatMsg);
 -	SkinAddNewSoundEx(AWAYSYS_STATUSMSGREQUEST_SOUND, NULL, LPGEN("NewAwaySys: Incoming status message request"));
 +	Skin_AddSound(AWAYSYS_STATUSMSGREQUEST_SOUND, nullptr, LPGENW("NewAwaySys: Incoming status message request"));
  	if (ServiceExists(MS_VARS_REGISTERTOKEN)) {
  		CreateServiceFunction(MS_AWAYSYS_FREEVARMEM, srvFreeVarMem);
 diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp index 8d5a27e7b1..6c7d5e9ee5 100644 --- a/plugins/NewXstatusNotify/src/indsnd.cpp +++ b/plugins/NewXstatusNotify/src/indsnd.cpp @@ -35,13 +35,13 @@ void PreviewSound(HWND hList)  	ListView_GetItemText(hList, lvi.iItem, 1, buff, _countof(buff));
  	if (!mir_wstrcmp(buff, TranslateW(DEFAULT_SOUND))) {
  		if (hlpStatus < ID_STATUS_MIN)
 -			SkinPlaySound(StatusListEx[hlpStatus].lpzSkinSoundName);
 +			Skin_PlaySound(StatusListEx[hlpStatus].lpzSkinSoundName);
  		else
 -			SkinPlaySound(StatusList[Index(hlpStatus)].lpzSkinSoundName);
 +			Skin_PlaySound(StatusList[Index(hlpStatus)].lpzSkinSoundName);
  	}
  	else {
  		PathToAbsoluteW(buff, stzSoundPath);
 -		SkinPlaySoundFile(stzSoundPath);
 +		Skin_PlaySoundFile(stzSoundPath);
  	}
  }
 diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index aca8e1d4fd..fa54d48e23 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -334,13 +334,13 @@ void PlayChangeSound(MCONTACT hContact, const char *name)  			//Now make path to IndSound absolute, as it isn't registered
  			wchar_t stzSoundPath[MAX_PATH];
  			PathToAbsoluteW(stzSoundFile, stzSoundPath);
 -			SkinPlaySoundFile(stzSoundPath);
 +			Skin_PlaySoundFile(stzSoundPath);
  			return;
  		}
  	}
  	if (db_get_b(0, "SkinSoundsOff", name, 0) == 0)
 -		SkinPlaySound(name);
 +		Skin_PlaySound(name);
  }
  int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus)
 @@ -1104,10 +1104,10 @@ void InitIcolib()  void InitSound()
  {
  	for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX; i++)
 -		SkinAddNewSoundExW(StatusList[Index(i)].lpzSkinSoundName, LPGENW("Status Notify"), StatusList[Index(i)].lpzSkinSoundDesc);
 +		Skin_AddSound(StatusList[Index(i)].lpzSkinSoundName, LPGENW("Status Notify"), StatusList[Index(i)].lpzSkinSoundDesc);
  	for (int i = 0; i <= ID_STATUSEX_MAX; i++)
 -		SkinAddNewSoundExW(StatusListEx[i].lpzSkinSoundName, LPGENW("Status Notify"), StatusListEx[i].lpzSkinSoundDesc);
 +		Skin_AddSound(StatusListEx[i].lpzSkinSoundName, LPGENW("Status Notify"), StatusListEx[i].lpzSkinSoundDesc);
  }
  int InitTopToolbar(WPARAM, LPARAM)
 diff --git a/plugins/NotesAndReminders/src/main.cpp b/plugins/NotesAndReminders/src/main.cpp index 8341330d1a..e006e4f13b 100644 --- a/plugins/NotesAndReminders/src/main.cpp +++ b/plugins/NotesAndReminders/src/main.cpp @@ -150,9 +150,9 @@ static void InitServices()  {
  	// register sounds
 -	SkinAddNewSoundEx("AlertReminder", LPGEN("Alerts"), LPGEN("Reminder triggered"));
 -	SkinAddNewSoundEx("AlertReminder2", LPGEN("Alerts"), LPGEN("Reminder triggered (Alternative 1)"));
 -	SkinAddNewSoundEx("AlertReminder3", LPGEN("Alerts"), LPGEN("Reminder triggered (Alternative 2)"));
 +	Skin_AddSound("AlertReminder",  LPGENW("Alerts"), LPGENW("Reminder triggered"));
 +	Skin_AddSound("AlertReminder2", LPGENW("Alerts"), LPGENW("Reminder triggered (Alternative 1)"));
 +	Skin_AddSound("AlertReminder3", LPGENW("Alerts"), LPGENW("Reminder triggered (Alternative 2)"));
  	// register menu command services
 diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp index f999000d78..3bb2361b9a 100644 --- a/plugins/NotesAndReminders/src/reminders.cpp +++ b/plugins/NotesAndReminders/src/reminders.cpp @@ -458,10 +458,10 @@ void GetTriggerTimeString(const ULARGE_INTEGER *When, char *s, UINT strSize, BOO  	else mir_snprintf(s, strSize, "%d-%02d-%02d %02d:%02d", tm.wYear, tm.wMonth, tm.wDay, tm.wHour, tm.wMinute);
  }
 -static void SkinPlaySoundPoly(LPCSTR pszSoundName)
 +static void Skin_PlaySoundPoly(LPCSTR pszSoundName)
  {
  	if (g_UseDefaultPlaySound) {
 -		SkinPlaySound(pszSoundName);
 +		Skin_PlaySound(pszSoundName);
  		return;
  	}
 @@ -501,10 +501,10 @@ static void UpdateReminderEvent(REMINDERDATA *pReminder, UINT nElapsedSeconds, B  			if (!(*pHasPlayedSound & dwSoundMask)) {
  				switch (pReminder->SoundSel) {
 -				case 1: SkinPlaySoundPoly("AlertReminder2"); break;
 -				case 2: SkinPlaySoundPoly("AlertReminder3"); break;
 +				case 1: Skin_PlaySoundPoly("AlertReminder2"); break;
 +				case 2: Skin_PlaySoundPoly("AlertReminder3"); break;
  				default:
 -					SkinPlaySoundPoly("AlertReminder");
 +					Skin_PlaySoundPoly("AlertReminder");
  				}
  				*pHasPlayedSound |= dwSoundMask;
 @@ -546,10 +546,10 @@ static void FireReminder(REMINDERDATA *pReminder, BOOL *pHasPlayedSound)  	if (!(*pHasPlayedSound & dwSoundMask)) {
  		switch (pReminder->SoundSel) {
 -		case 1: SkinPlaySoundPoly("AlertReminder2"); break;
 -		case 2: SkinPlaySoundPoly("AlertReminder3"); break;
 +		case 1: Skin_PlaySoundPoly("AlertReminder2"); break;
 +		case 2: Skin_PlaySoundPoly("AlertReminder3"); break;
  		default:
 -			SkinPlaySoundPoly("AlertReminder");
 +			Skin_PlaySoundPoly("AlertReminder");
  		}
  		*pHasPlayedSound |= dwSoundMask;
 @@ -1825,9 +1825,9 @@ static INT_PTR CALLBACK DlgProcNewReminder(HWND Dialog, UINT Message, WPARAM wPa  					int n = SendDlgItemMessage(Dialog, IDC_COMBO_SOUND, CB_GETCURSEL, 0, 0);
  					n = (int)SendDlgItemMessage(Dialog, IDC_COMBO_SOUND, CB_GETITEMDATA, n, 0);
  					switch (n) {
 -					case 0: SkinPlaySound("AlertReminder"); break;
 -					case 1: SkinPlaySound("AlertReminder2"); break;
 -					case 2: SkinPlaySound("AlertReminder3"); break;
 +					case 0: Skin_PlaySound("AlertReminder"); break;
 +					case 1: Skin_PlaySound("AlertReminder2"); break;
 +					case 2: Skin_PlaySound("AlertReminder3"); break;
  					}
  				}
  				return TRUE;
 diff --git a/plugins/NotifyAnything/src/main.cpp b/plugins/NotifyAnything/src/main.cpp index 3e72bf9f3d..598837dfc3 100644 --- a/plugins/NotifyAnything/src/main.cpp +++ b/plugins/NotifyAnything/src/main.cpp @@ -142,15 +142,7 @@ void registerSound(const std::wstring &name)  	std::wstring id = L"NotifyAnything_" + name;
  	std::wstring desc = L"NotifyAnything: " + name;
  	std::wstring file = name + L".wav";
 -
 -	SKINSOUNDDESCEX ssd = { 0 };
 -	ssd.cbSize = sizeof(ssd);
 -	ssd.dwFlags = SSDF_UNICODE;
 -	ssd.pszName = _T2A(id.c_str());
 -	ssd.pwszSection = LPGENW("Notify Anything");
 -	ssd.pwszDescription = desc.c_str();
 -	ssd.pwszDefaultFile = file.c_str();
 -	Skin_AddSound(&ssd);
 +	Skin_AddSound(_T2A(id.c_str()), LPGENW("Notify Anything"), desc.c_str(), file.c_str());
  }
  HICON getIcon(const std::wstring &name)
 @@ -823,7 +815,7 @@ void processMessage(std::wstring buf)  				Beep(650, 50);
  			else {
  				std::wstring sname = L"NotifyAnything_" + msg.sound;
 -				SkinPlaySound(_T2A(sname.c_str()));
 +				Skin_PlaySound(_T2A(sname.c_str()));
  			}
  		}
  	}
 diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp index a956df53bd..5c90b286ae 100644 --- a/plugins/Nudge/src/main.cpp +++ b/plugins/Nudge/src/main.cpp @@ -139,7 +139,7 @@ int NudgeReceived(WPARAM hContact, LPARAM lParam)  							if (p.autoResend)
  								mir_forkthread(AutoResendNudge, (void*)hContact);
 -							SkinPlaySound(p.NudgeSoundname);
 +							Skin_PlaySound(p.NudgeSoundname);
  						}
  					}
 @@ -182,7 +182,7 @@ int NudgeReceived(WPARAM hContact, LPARAM lParam)  					if (DefaultNudge.autoResend)
  						mir_forkthread(AutoResendNudge, (void*)hContact);
 -					SkinPlaySound(DefaultNudge.NudgeSoundname);
 +					Skin_PlaySound(DefaultNudge.NudgeSoundname);
  				}
  			}
 @@ -210,7 +210,7 @@ void LoadProtocols(void)  	//Load the default nudge
  	mir_snprintf(DefaultNudge.ProtocolName, "Default");
  	mir_snprintf(DefaultNudge.NudgeSoundname, "Nudge : Default");
 -	SkinAddNewSoundEx(DefaultNudge.NudgeSoundname, LPGEN("Nudge"), LPGEN("Default Nudge"));
 +	Skin_AddSound(DefaultNudge.NudgeSoundname, LPGENW("Nudge"), LPGENW("Default Nudge"));
  	DefaultNudge.Load();
  	GlobalNudge.Load();
 @@ -411,7 +411,7 @@ int Preview()  		for (int i = 0; i < arNudges.getCount(); i++) {
  			CNudgeElement &p = arNudges[i];
  			if (p.enabled) {
 -				SkinPlaySound(p.NudgeSoundname);
 +				Skin_PlaySound(p.NudgeSoundname);
  				if (p.showPopup)
  					Nudge_ShowPopup(&p, hContact, p.recText);
  				if (p.openContactList)
 @@ -427,7 +427,7 @@ int Preview()  	}
  	else {
  		if (DefaultNudge.enabled) {
 -			SkinPlaySound(DefaultNudge.NudgeSoundname);
 +			Skin_PlaySound(DefaultNudge.NudgeSoundname);
  			if (DefaultNudge.showPopup)
  				Nudge_ShowPopup(&DefaultNudge, hContact, DefaultNudge.recText);
  			if (DefaultNudge.openContactList)
 @@ -525,7 +525,7 @@ void Nudge_AddAccount(PROTOACCOUNT *proto)  	wchar_t soundDesc[MAXMODULELABELLENGTH + 10];
  	mir_snwprintf(soundDesc, LPGENW("Nudge for %s"), proto->tszAccountName);
 -	SkinAddNewSoundExW(p->NudgeSoundname, LPGENW("Nudge"), soundDesc);
 +	Skin_AddSound(p->NudgeSoundname, LPGENW("Nudge"), soundDesc);
  	arNudges.insert(p);
  }
 diff --git a/plugins/Ping/src/ping.cpp b/plugins/Ping/src/ping.cpp index 7688afb496..7dd24e6a26 100644 --- a/plugins/Ping/src/ping.cpp +++ b/plugins/Ping/src/ping.cpp @@ -138,8 +138,8 @@ extern "C" __declspec(dllexport) int Load(void)  	LoadOptions();
 -	SkinAddNewSoundEx("PingTimeout", LPGEN("Ping"), LPGEN("Timeout"));
 -	SkinAddNewSoundEx("PingReply", LPGEN("Ping"), LPGEN("Reply"));
 +	Skin_AddSound("PingTimeout", LPGENW("Ping"), LPGENW("Timeout"));
 +	Skin_AddSound("PingReply", LPGENW("Ping"), LPGENW("Reply"));
  	HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
 diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index c3d215329d..06c5b8963e 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -218,8 +218,8 @@ void __cdecl sttCheckStatusThreadProc(void*)  			}
  		}
 -		if (timeout) SkinPlaySound("PingTimeout");
 -		if (reply) SkinPlaySound("PingReply");
 +		if (timeout) Skin_PlaySound("PingTimeout");
 +		if (reply) Skin_PlaySound("PingReply");
  		if (!get_list_changed()) {
  			upCount = count;
 diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp index 6d54f2e342..8aada80df1 100644 --- a/plugins/PluginUpdater/src/DlgUpdate.cpp +++ b/plugins/PluginUpdater/src/DlgUpdate.cpp @@ -87,7 +87,7 @@ static void ApplyUpdates(void *param)  				// interrupt update as we require all components to be updated
  				Netlib_CloseHandle(nlc);
  				PostMessage(hDlg, UM_ERROR, 0, 0);
 -				SkinPlaySound("updatefailed");
 +				Skin_PlaySound("updatefailed");
  				return;
  			}
  			SetStringText(hwndList, i, TranslateT("Succeeded."));
 @@ -121,7 +121,7 @@ static void ApplyUpdates(void *param)  			}
  		}
  	}
 -	SkinPlaySound("updatecompleted");
 +	Skin_PlaySound("updatecompleted");
  #if MIRANDA_VER < 0x0A00
  	// 4) Change title of clist
 @@ -429,7 +429,7 @@ static void DlgUpdateSilent(void *param)  			if (!DownloadFile(pFileUrl, nlc)) {
  				// interrupt update as we require all components to be updated
  				Netlib_CloseHandle(nlc);
 -				SkinPlaySound("updatefailed");
 +				Skin_PlaySound("updatefailed");
  				delete &UpdateFiles;
  				return;
  			}
 @@ -473,7 +473,7 @@ static void DlgUpdateSilent(void *param)  		}
  	}
  	delete &UpdateFiles;
 -	SkinPlaySound("updatecompleted");
 +	Skin_PlaySound("updatecompleted");
  #if MIRANDA_VER < 0x0A00
  	// 4) Change title of clist
 diff --git a/plugins/PluginUpdater/src/PluginUpdater.cpp b/plugins/PluginUpdater/src/PluginUpdater.cpp index 9c09f5a6f9..49507acd15 100644 --- a/plugins/PluginUpdater/src/PluginUpdater.cpp +++ b/plugins/PluginUpdater/src/PluginUpdater.cpp @@ -126,8 +126,8 @@ extern "C" __declspec(dllexport) int Load(void)  	InitEvents();
  	// add sounds
 -	SkinAddNewSoundEx("updatecompleted", LPGEN("Plugin Updater"), LPGEN("Update completed"));
 -	SkinAddNewSoundEx("updatefailed", LPGEN("Plugin Updater"), LPGEN("Update failed"));
 +	Skin_AddSound("updatecompleted", LPGENW("Plugin Updater"), LPGENW("Update completed"));
 +	Skin_AddSound("updatefailed",    LPGENW("Plugin Updater"), LPGENW("Update failed"));
  #if MIRANDA_VER >= 0x0A00
  	// Upgrade old settings
 diff --git a/plugins/PluginUpdater/src/Utils.cpp b/plugins/PluginUpdater/src/Utils.cpp index c136c5c20c..7554c723ef 100644 --- a/plugins/PluginUpdater/src/Utils.cpp +++ b/plugins/PluginUpdater/src/Utils.cpp @@ -163,14 +163,14 @@ bool ParseHashes(const wchar_t *ptszUrl, ptrW &baseUrl, SERVLIST &arHashes)  	if (!ret) {
  		Netlib_LogfW(hNetlibUser,L"Downloading list of available updates from %s failed",baseUrl);
  		ShowPopup(TranslateT("Plugin Updater"), TranslateT("An error occurred while checking for new updates."), POPUP_TYPE_ERROR);
 -		SkinPlaySound("updatefailed");
 +		Skin_PlaySound("updatefailed");
  		return false;
  	}
  	if(!unzip(pFileUrl.tszDiskPath, g_tszTempPath, NULL,true)) {
  		Netlib_LogfW(hNetlibUser,L"Unzipping list of available updates from %s failed",baseUrl);
  		ShowPopup(TranslateT("Plugin Updater"), TranslateT("An error occurred while checking for new updates."), POPUP_TYPE_ERROR);
 -		SkinPlaySound("updatefailed");
 +		Skin_PlaySound("updatefailed");
  		return false;
  	}
 diff --git a/plugins/SMS/src/SMSConstans.h b/plugins/SMS/src/SMSConstans.h index b212510210..9a48672f9f 100644 --- a/plugins/SMS/src/SMSConstans.h +++ b/plugins/SMS/src/SMSConstans.h @@ -2,6 +2,7 @@  #define AFX_SMS_CONSTANS_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_
  #define PROTOCOL_NAMEA			"SMSPlugin"
 +#define PROTOCOL_NAMEW			L"SMSPlugin"
  #define PROTOCOL_NAME_LEN		(sizeof(PROTOCOL_NAMEA)-1)
  #define PROTOCOL_NAME_SIZE		sizeof(PROTOCOL_NAMEA)
  #define PROTOCOL_DISPLAY_NAME_ORIG	"SMS"
 diff --git a/plugins/SMS/src/SMS_svc.cpp b/plugins/SMS/src/SMS_svc.cpp index a88d44f33e..b224343cd0 100644 --- a/plugins/SMS/src/SMS_svc.cpp +++ b/plugins/SMS/src/SMS_svc.cpp @@ -45,8 +45,8 @@ int LoadModules(void)  	mi.flags = CMIF_UNICODE;
  	ssSMSSettings.hContactMenuItems[0] = Menu_AddContactMenuItem(&mi);
 -	SkinAddNewSoundEx("RecvSMSMsg", PROTOCOL_NAMEA, LPGEN("Incoming SMS Message"));
 -	SkinAddNewSoundEx("RecvSMSConfirmation", PROTOCOL_NAMEA, LPGEN("Incoming SMS Confirmation"));
 +	Skin_AddSound("RecvSMSMsg", PROTOCOL_NAMEW, LPGENW("Incoming SMS Message"));
 +	Skin_AddSound("RecvSMSConfirmation", PROTOCOL_NAMEW, LPGENW("Incoming SMS Confirmation"));
  	RefreshAccountList(NULL, NULL);
 diff --git a/plugins/SMS/src/receive.cpp b/plugins/SMS/src/receive.cpp index 28ad76e8c0..c576e2cdd3 100644 --- a/plugins/SMS/src/receive.cpp +++ b/plugins/SMS/src/receive.cpp @@ -75,7 +75,7 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam)  				if (hContact == NULL) {
  					if (RecvSMSWindowAdd(NULL, ICQEVENTTYPE_SMS, tszPhone, dwPhoneSize, (LPSTR)dbei.pBlob, dbei.cbBlob)) {
  						db_event_markRead(hContact, hResult);
 -						SkinPlaySound("RecvSMSMsg");
 +						Skin_PlaySound("RecvSMSMsg");
  					}
  				}
  			}
 @@ -224,7 +224,7 @@ int handleNewMessage(WPARAM hContact, LPARAM hDbEvent)  	if ((dbei.flags & DBEF_SENT) == 0)
  	if (dbei.eventType == ICQEVENTTYPE_SMS) {
  		if (dbei.cbBlob > MIN_SMS_DBEVENT_LEN) {
 -			SkinPlaySound("RecvSMSMsg");
 +			Skin_PlaySound("RecvSMSMsg");
  			if (DB_SMS_GetByte(NULL, "AutoPopup", 0)) {
  				if (RecvSMSWindowAdd(hContact, ICQEVENTTYPE_SMS, NULL, 0, (LPSTR)dbei.pBlob, dbei.cbBlob))
  					db_event_markRead(hContact, hDbEvent);
 @@ -245,7 +245,7 @@ int handleNewMessage(WPARAM hContact, LPARAM hDbEvent)  		}
  	}
  	else if (dbei.eventType == ICQEVENTTYPE_SMSCONFIRMATION) {
 -		SkinPlaySound("RecvSMSConfirmation");
 +		Skin_PlaySound("RecvSMSConfirmation");
  		if (DB_SMS_GetByte(NULL, "AutoPopup", 0)) {
  			if (RecvSMSWindowAdd(hContact, ICQEVENTTYPE_SMSCONFIRMATION, NULL, 0, (LPSTR)dbei.pBlob, dbei.cbBlob))
  				db_event_delete(hContact, hDbEvent);
 diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp index 7a174bf528..97ac6a7adf 100644 --- a/plugins/Scriver/src/globals.cpp +++ b/plugins/Scriver/src/globals.cpp @@ -161,7 +161,7 @@ static int ackevent(WPARAM, LPARAM lParam)  	}
  	else if (hwndSender != nullptr) {
  		SendMessage(hwndSender, DM_STOPMESSAGESENDING, 0, 0);
 -		SkinPlaySound("SendMsg");
 +		Skin_PlaySound("SendMsg");
  	}
  	return 0;
 diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index c642e0e422..cd49dd8bdd 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -1435,8 +1435,8 @@ INT_PTR CSrmmWindow::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)  					m_lastMessage = dbei.timestamp;
  					UpdateStatusBar();
  					if (GetForegroundWindow() == m_hwndParent && m_pParent->hwndActive == m_hwnd)
 -						SkinPlaySound("RecvMsgActive");
 -					else SkinPlaySound("RecvMsgInactive");
 +						Skin_PlaySound("RecvMsgActive");
 +					else Skin_PlaySound("RecvMsgInactive");
  					if ((g_dat.flags2 & SMF2_SWITCHTOACTIVE) && (IsIconic(m_hwndParent) || GetActiveWindow() != m_hwndParent) && IsWindowVisible(m_hwndParent))
  						SendMessage(m_hwndParent, CM_ACTIVATECHILD, 0, (LPARAM)m_hwnd);
  					if (IsAutoPopup(m_hContact))
 diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index d7a2e05b74..26ee901ae6 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -106,7 +106,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam)  	/* does a window for the contact exist? */
  	if (hwnd == nullptr) {
  		/* new message */
 -		SkinPlaySound("AlertMsg");
 +		Skin_PlaySound("AlertMsg");
  		if (IsAutoPopup(hContact)) {
  			(new CSrmmWindow(hContact, true))->Show();
  			return 0;
 @@ -188,7 +188,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam)  	hContact = db_mc_tryMeta(hContact);
 -	SkinPlaySound((lParam) ? "TNStart" : "TNStop");
 +	Skin_PlaySound((lParam) ? "TNStart" : "TNStop");
  	HWND hwnd = Srmm_FindWindow(hContact);
  	if (hwnd)
 @@ -647,12 +647,12 @@ int OnLoadModule(void)  	CreateServiceFunction(MS_MSG_SENDMESSAGEW, SendMessageCommandW);
  	CreateServiceFunction(MS_MSG_TYPINGMESSAGE, TypingMessageCommand);
 -	SkinAddNewSoundEx("RecvMsgActive", LPGEN("Instant messages"), LPGEN("Incoming (focused window)"));
 -	SkinAddNewSoundEx("RecvMsgInactive", LPGEN("Instant messages"), LPGEN("Incoming (unfocused window)"));
 -	SkinAddNewSoundEx("AlertMsg", LPGEN("Instant messages"), LPGEN("Incoming (new session)"));
 -	SkinAddNewSoundEx("SendMsg", LPGEN("Instant messages"), LPGEN("Outgoing"));
 -	SkinAddNewSoundEx("TNStart", LPGEN("Instant messages"), LPGEN("Contact started typing"));
 -	SkinAddNewSoundEx("TNStop", LPGEN("Instant messages"), LPGEN("Contact stopped typing"));
 +	Skin_AddSound("RecvMsgActive", LPGENW("Instant messages"), LPGENW("Incoming (focused window)"));
 +	Skin_AddSound("RecvMsgInactive", LPGENW("Instant messages"), LPGENW("Incoming (unfocused window)"));
 +	Skin_AddSound("AlertMsg", LPGENW("Instant messages"), LPGENW("Incoming (new session)"));
 +	Skin_AddSound("SendMsg", LPGENW("Instant messages"), LPGENW("Outgoing"));
 +	Skin_AddSound("TNStart", LPGENW("Instant messages"), LPGENW("Contact started typing"));
 +	Skin_AddSound("TNStop", LPGENW("Instant messages"), LPGENW("Contact stopped typing"));
  	hDragCursor = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_DRAGCURSOR));
 diff --git a/plugins/SecureIM/src/crypt_popups.cpp b/plugins/SecureIM/src/crypt_popups.cpp index 3bd02356dc..fbced3dd22 100644 --- a/plugins/SecureIM/src/crypt_popups.cpp +++ b/plugins/SecureIM/src/crypt_popups.cpp @@ -92,12 +92,12 @@ void showPopupSM(MCONTACT hContact)  {
  	if (db_get_b(0, MODULENAME, "ss", 0))
  		showPopup(sim009, hContact, g_hPOP[POP_PU_MSS], 2);
 -	SkinPlaySound("OutgoingSecureMessage");
 +	Skin_PlaySound("OutgoingSecureMessage");
  }
  void showPopupRM(MCONTACT hContact)
  {
  	if (db_get_b(0, MODULENAME, "sr", 0))
  		showPopup(sim010, hContact, g_hPOP[POP_PU_MSR], 2);
 -	SkinPlaySound("IncomingSecureMessage");
 +	Skin_PlaySound("IncomingSecureMessage");
  }
 diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp index 3e80b7db39..22a5ef4749 100644 --- a/plugins/SecureIM/src/main.cpp +++ b/plugins/SecureIM/src/main.cpp @@ -211,8 +211,8 @@ static int onModulesLoaded(WPARAM, LPARAM)  	loadContactList();
  	// add new skin sound
 -	SkinAddNewSoundEx("IncomingSecureMessage", LPGEN("SecureIM"), LPGEN("Incoming Secure Message"), "Sounds\\iSecureMessage.wav");
 -	SkinAddNewSoundEx("OutgoingSecureMessage", LPGEN("SecureIM"), LPGEN("Outgoing Secure Message"), "Sounds\\oSecureMessage.wav");
 +	Skin_AddSound("IncomingSecureMessage", LPGENW("SecureIM"), LPGENW("Incoming Secure Message"), L"Sounds\\iSecureMessage.wav");
 +	Skin_AddSound("OutgoingSecureMessage", LPGENW("SecureIM"), LPGENW("Outgoing Secure Message"), L"Sounds\\oSecureMessage.wav");
  	// init extra icons
  	for (int i = 0; i < _countof(g_IEC); i++)
 diff --git a/plugins/SeenPlugin/src/history.cpp b/plugins/SeenPlugin/src/history.cpp index b409a71ccb..28a959d7d4 100644 --- a/plugins/SeenPlugin/src/history.cpp +++ b/plugins/SeenPlugin/src/history.cpp @@ -297,7 +297,7 @@ void ShowHistory(MCONTACT hContact, BYTE isAlert)  	}
  	if (isAlert)
 -		SkinPlaySound("LastSeenTrackedStatusChange");
 +		Skin_PlaySound("LastSeenTrackedStatusChange");
  }
  void InitHistoryDialog(void)
 diff --git a/plugins/SeenPlugin/src/main.cpp b/plugins/SeenPlugin/src/main.cpp index 2261c98a46..ac6672a246 100644 --- a/plugins/SeenPlugin/src/main.cpp +++ b/plugins/SeenPlugin/src/main.cpp @@ -104,10 +104,10 @@ extern "C" __declspec(dllexport) int Load(void)  	LoadWatchedProtos();
 -	SkinAddNewSoundExW("LastSeenTrackedStatusChange", LPGENW("LastSeen"), LPGENW("User status change"));
 -	SkinAddNewSoundExW("LastSeenTrackedStatusOnline", LPGENW("LastSeen"), LPGENW("Changed to Online"));
 -	SkinAddNewSoundExW("LastSeenTrackedStatusOffline", LPGENW("LastSeen"), LPGENW("User Logged Off"));
 -	SkinAddNewSoundExW("LastSeenTrackedStatusFromOffline", LPGENW("LastSeen"), LPGENW("User Logged In"));
 +	Skin_AddSound("LastSeenTrackedStatusChange", LPGENW("LastSeen"), LPGENW("User status change"));
 +	Skin_AddSound("LastSeenTrackedStatusOnline", LPGENW("LastSeen"), LPGENW("Changed to Online"));
 +	Skin_AddSound("LastSeenTrackedStatusOffline", LPGENW("LastSeen"), LPGENW("User Logged Off"));
 +	Skin_AddSound("LastSeenTrackedStatusFromOffline", LPGENW("LastSeen"), LPGENW("User Logged In"));
  	return 0;
  }
 diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index cff0c704de..e9e043d824 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -510,7 +510,7 @@ void myPlaySound(MCONTACT hcontact, WORD newStatus, WORD oldStatus)  	else if (oldStatus == ID_STATUS_OFFLINE) soundname = "LastSeenTrackedStatusFromOffline";
  	else soundname = "LastSeenTrackedStatusChange";
  	if (soundname != NULL)
 -		SkinPlaySound(soundname);
 +		Skin_PlaySound(soundname);
  }
  // will add hContact to queue and will return position;
 diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp index 194e8ac4a0..6ec66563aa 100644 --- a/plugins/SendScreenshotPlus/src/CSend.cpp +++ b/plugins/SendScreenshotPlus/src/CSend.cpp @@ -418,17 +418,17 @@ void CSend::Exit(unsigned int Result)  		bool err = true;  		switch (Result) {  		case CSEND_DIALOG: -			SkinPlaySound("FileDone"); +			Skin_PlaySound("FileDone");  			DialogBoxParam(g_hSendSS, MAKEINTRESOURCE(IDD_UResultForm), 0, ResultDialogProc, (LPARAM)this);  			err = false;  			break;  		case ACKRESULT_SUCCESS:  		case GC_RESULT_SUCCESS: -			SkinPlaySound("FileDone"); +			Skin_PlaySound("FileDone");  			err = false;  			break;  		case ACKRESULT_DENIED: -			SkinPlaySound("FileDenied"); +			Skin_PlaySound("FileDenied");  			Error(L"%s (%i):\nFile transfer denied.", TranslateW(m_pszSendTyp), Result);  			MsgBoxService(NULL, (LPARAM)&m_box);  			err = false; @@ -447,7 +447,7 @@ void CSend::Exit(unsigned int Result)  			break;  		}  		if (err) { -			SkinPlaySound("FileFailed"); +			Skin_PlaySound("FileFailed");  			if (m_ErrorMsg) MsgBoxService(NULL, (LPARAM)&m_box);  			else MsgErr(NULL, LPGENW("An unknown error has occurred."));  		} diff --git a/plugins/TabSRMM/src/chat_tools.cpp b/plugins/TabSRMM/src/chat_tools.cpp index b27e605d2a..864745498f 100644 --- a/plugins/TabSRMM/src/chat_tools.cpp +++ b/plugins/TabSRMM/src/chat_tools.cpp @@ -214,11 +214,11 @@ void DoFlashAndSoundWorker(FLASH_PARAMS *p)  			p->bInactive = dat->m_pContainer->m_hwnd != GetForegroundWindow();
  			p->bActiveTab = (dat->m_pContainer->m_hwndActive == si->pDlg->GetHwnd());
  			if (p->sound && dat->MustPlaySound())
 -				SkinPlaySound(p->sound);
 +				Skin_PlaySound(p->sound);
  		}
  	}
  	else if (p->sound)
 -		SkinPlaySound(p->sound);
 +		Skin_PlaySound(p->sound);
  	if (dat) {
  		HWND hwndTab = GetParent(si->pDlg->GetHwnd());
 diff --git a/plugins/TabSRMM/src/chat_window.cpp b/plugins/TabSRMM/src/chat_window.cpp index 7b2fd8f54a..cb105d1aee 100644 --- a/plugins/TabSRMM/src/chat_window.cpp +++ b/plugins/TabSRMM/src/chat_window.cpp @@ -665,7 +665,7 @@ void CChatRoomDlg::onClick_OK(CCtrlButton*)  	UpdateStatusBar();  	if (m_pContainer)  		if (fSound && !nen_options.iNoSounds && !(m_pContainer->dwFlags & CNT_NOSOUND)) -			SkinPlaySound("ChatSent"); +			Skin_PlaySound("ChatSent");  	SetFocus(m_message.GetHwnd());  } @@ -1193,7 +1193,7 @@ LRESULT CChatRoomDlg::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam)  		KbdState(isShift, isCtrl, isAlt);  		if (PluginConfig.m_bSoundOnTyping && !isAlt && !isCtrl && !(m_pContainer->dwFlags & CNT_NOSOUND) && wParam != VK_ESCAPE && !(wParam == VK_TAB && PluginConfig.m_bAllowTab)) -			SkinPlaySound("SoundOnTyping"); +			Skin_PlaySound("SoundOnTyping");  		if (isCtrl && !isAlt && !isShift)  			switch (wParam) { @@ -1209,7 +1209,7 @@ LRESULT CChatRoomDlg::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam)  		// sound on typing..  		if (PluginConfig.m_bSoundOnTyping && !isAlt && wParam == VK_DELETE) -			SkinPlaySound("SoundOnTyping"); +			Skin_PlaySound("SoundOnTyping");  		if (wParam != VK_ESCAPE)  			if (ProcessHotkeys(wParam, isShift, isCtrl, isAlt)) diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index 5b4539fb8f..298bee3138 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -69,11 +69,11 @@ void CGlobals::reloadSystemStartup()  	PluginConfig.g_hMenuContext = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_TABCONTEXT));
  	TranslateMenu(g_hMenuContext);
 -	SkinAddNewSoundEx("RecvMsgActive", LPGEN("Instant messages"), LPGEN("Incoming (focused window)"));
 -	SkinAddNewSoundEx("RecvMsgInactive", LPGEN("Instant messages"), LPGEN("Incoming (unfocused window)"));
 -	SkinAddNewSoundEx("AlertMsg", LPGEN("Instant messages"), LPGEN("Incoming (new session)"));
 -	SkinAddNewSoundEx("SendMsg", LPGEN("Instant messages"), LPGEN("Outgoing"));
 -	SkinAddNewSoundEx("SendError", LPGEN("Instant messages"), LPGEN("Message send error"));
 +	Skin_AddSound("RecvMsgActive",   LPGENW("Instant messages"), LPGENW("Incoming (focused window)"));
 +	Skin_AddSound("RecvMsgInactive", LPGENW("Instant messages"), LPGENW("Incoming (unfocused window)"));
 +	Skin_AddSound("AlertMsg",        LPGENW("Instant messages"), LPGENW("Incoming (new session)"));
 +	Skin_AddSound("SendMsg",         LPGENW("Instant messages"), LPGENW("Outgoing"));
 +	Skin_AddSound("SendError",       LPGENW("Instant messages"), LPGENW("Message send error"));
  	hCurSplitNS = LoadCursor(nullptr, IDC_SIZENS);
  	hCurSplitWE = LoadCursor(nullptr, IDC_SIZEWE);
 @@ -212,7 +212,7 @@ void CGlobals::reloadAdv()  	m_bDontUseDefaultKbd = M.GetBool("adv_leaveKeyboardAlone", true);
  	if (m_bSoundOnTyping && m_TypingSoundAdded == false) {
 -		SkinAddNewSoundEx("SoundOnTyping", LPGEN("Other"), LPGEN("TabSRMM: typing"));
 +		Skin_AddSound("SoundOnTyping", LPGENW("Other"), LPGENW("TabSRMM: typing"));
  		m_TypingSoundAdded = true;
  	}
  	m_bAllowOfflineMultisend = M.GetBool("AllowOfflineMultisend", true);
 diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index a275fa74be..d1af47ec4b 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -238,7 +238,7 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode)  	else fShowOnClist = false;  	if ((!foundWin || !(pContainer->dwFlags & CNT_NOSOUND)) && preTyping != (mode != 0)) -		SkinPlaySound(mode ? "TNStart" : "TNStop"); +		Skin_PlaySound(mode ? "TNStart" : "TNStop");  	if (M.GetByte(SRMSGMOD, "ShowTypingPopup", 0)) {  		BOOL fShow = false; @@ -447,7 +447,7 @@ int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM hDbEvent)  	// if no window is open, we are not interested in anything else but unread message events  	// new message  	if (!nen_options.iNoSounds) -		SkinPlaySound("AlertMsg"); +		Skin_PlaySound("AlertMsg");  	if (nen_options.iNoAutoPopup)  		goto nowindowcreate; diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 2eba71af45..147555a9c3 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -1991,7 +1991,7 @@ LRESULT CSrmmWindow::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam)  		KbdState(isShift, isCtrl, isAlt);
  		if (PluginConfig.m_bSoundOnTyping && !isAlt && !isCtrl && !(m_pContainer->dwFlags & CNT_NOSOUND) && wParam != VK_ESCAPE && !(wParam == VK_TAB && PluginConfig.m_bAllowTab))
 -			SkinPlaySound("SoundOnTyping");
 +			Skin_PlaySound("SoundOnTyping");
  		if (isCtrl && !isAlt) {
  			switch (wParam) {
 @@ -2044,7 +2044,7 @@ LRESULT CSrmmWindow::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam)  		KbdState(isShift, isCtrl, isAlt);
  		if (PluginConfig.m_bSoundOnTyping && !isAlt && !(m_pContainer->dwFlags & CNT_NOSOUND) && wParam == VK_DELETE)
 -			SkinPlaySound("SoundOnTyping");
 +			Skin_PlaySound("SoundOnTyping");
  		if (wParam == VK_INSERT && !isShift && !isCtrl && !isAlt) {
  			m_bInsertMode = !m_bInsertMode;
 @@ -2679,7 +2679,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)  				mir_snwprintf(job->szErrorMsg, TranslateT("Delivery failure: %s"), TranslateT("The message send timed out"));
  				job->iStatus = SendQueue::SQ_ERROR;
  				if (!nen_options.iNoSounds && !(m_pContainer->dwFlags & CNT_NOSOUND))
 -					SkinPlaySound("SendError");
 +					Skin_PlaySound("SendError");
  				if (!(m_dwFlags & MWF_ERRORSTATE))
  					sendQueue->handleError(this, iIndex);
  				break;
 diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 24487881b8..09f477af63 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -1162,9 +1162,9 @@ void CTabBaseDlg::PlayIncomingSound() const  	int iPlay = MustPlaySound();
  	if (iPlay) {
  		if (GetForegroundWindow() == m_pContainer->m_hwnd && m_pContainer->m_hwndActive == m_hwnd)
 -			SkinPlaySound("RecvMsgActive");
 +			Skin_PlaySound("RecvMsgActive");
  		else
 -			SkinPlaySound("RecvMsgInactive");
 +			Skin_PlaySound("RecvMsgInactive");
  	}
  }
 diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index b78867654f..cae1d654e7 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -442,7 +442,7 @@ int SendQueue::ackMessage(CTabBaseDlg *dat, WPARAM wParam, LPARAM lParam)  			// "hard" errors are handled differently in multisend. There is no option to retry - once failed, they  			// are discarded and the user is notified with a small log message.  			if (!nen_options.iNoSounds && !(m_pContainer->dwFlags & CNT_NOSOUND)) -				SkinPlaySound("SendError"); +				Skin_PlaySound("SendError");  			mir_snwprintf(job.szErrorMsg, TranslateT("Delivery failure: %s"), _A2T((char *)ack->lParam));  			job.iStatus = SQ_ERROR; @@ -485,7 +485,7 @@ int SendQueue::ackMessage(CTabBaseDlg *dat, WPARAM wParam, LPARAM lParam)  	if (m_pContainer)  		if (!nen_options.iNoSounds && !(m_pContainer->dwFlags & CNT_NOSOUND)) -			SkinPlaySound("SendMsg"); +			Skin_PlaySound("SendMsg");  	Srmm_Broadcast(DM_APPENDMCEVENT, job.hContact, hNewEvent); diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp index 0e133464a3..42a3238131 100644 --- a/plugins/TabSRMM/src/typingnotify.cpp +++ b/plugins/TabSRMM/src/typingnotify.cpp @@ -548,8 +548,8 @@ int TN_ModuleInit()  		hDisableMenu = Menu_AddMainMenuItem(&mi);
  	}
 -	SkinAddNewSoundEx("TNStart", LPGEN("Instant messages"), LPGEN("Contact started typing"));
 -	SkinAddNewSoundEx("TNStop", LPGEN("Instant messages"), LPGEN("Contact stopped typing"));
 +	Skin_AddSound("TNStart", LPGENW("Instant messages"), LPGENW("Contact started typing"));
 +	Skin_AddSound("TNStop", LPGENW("Instant messages"), LPGENW("Contact stopped typing"));
  	return 0;
  }
 diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index fc3e2ccd9d..9b17cb37e6 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -133,14 +133,13 @@ int CTooltipNotify::ModulesLoaded(WPARAM, LPARAM)  		db_set_b(NULL, MODULENAME, "firstrun", 0);
  	}
 -	SkinAddNewSoundEx(SND_ONLINE, LPGEN("Tooltip Notify"), LPGEN("Online"), "online.wav");
 -	SkinAddNewSoundEx(SND_OFFLINE, LPGEN("Tooltip Notify"), LPGEN("Offline"), "offline.wav");
 -	SkinAddNewSoundEx(SND_OTHER, LPGEN("Tooltip Notify"), LPGEN("Other"), "other.wav");
 -	SkinAddNewSoundEx(SND_TYPING, LPGEN("Tooltip Notify"), LPGEN("Typing"), "typing.wav");
 +	Skin_AddSound(SND_ONLINE,  LPGENW("Tooltip Notify"), LPGENW("Online"),  L"online.wav");
 +	Skin_AddSound(SND_OFFLINE, LPGENW("Tooltip Notify"), LPGENW("Offline"), L"offline.wav");
 +	Skin_AddSound(SND_OTHER,   LPGENW("Tooltip Notify"), LPGENW("Other"),   L"other.wav");
 +	Skin_AddSound(SND_TYPING,  LPGENW("Tooltip Notify"), LPGENW("Typing"),  L"typing.wav");
  	// register fonts
  	RegisterFonts();
 -
  	return 0;
  }
 @@ -156,7 +155,7 @@ int CTooltipNotify::ProtoContactIsTyping(WPARAM hContact, LPARAM lParam)  		pTooltipData->iStatus = ID_TTNTF_STATUS_TYPING;
  		EndNotifyAll();
 -		SkinPlaySound(SND_TYPING);
 +		Skin_PlaySound(SND_TYPING);
  		BeginNotify(pTooltipData);
  	}
  	else EndNotifyAll();
 @@ -225,18 +224,18 @@ int CTooltipNotify::ContactSettingChanged(WPARAM hContact, LPARAM lParam)  	switch (wNewStatus) {
  	case ID_STATUS_OFFLINE:
  		if (!m_sOptions.bOffline) return 0;
 -		SkinPlaySound(SND_OFFLINE);
 +		Skin_PlaySound(SND_OFFLINE);
  		break;
  	case ID_STATUS_ONLINE:
  		if (CallService(MS_IGNORE_ISIGNORED, hContact, IGNOREEVENT_USERONLINE) && m_sOptions.bConjSOLN) return 0;
  		if (!m_sOptions.bOnline) return 0;
 -		SkinPlaySound(SND_ONLINE);
 +		Skin_PlaySound(SND_ONLINE);
  		break;
  	default:
  		if (!m_sOptions.bOther) return 0;
 -		SkinPlaySound(SND_OTHER);
 +		Skin_PlaySound(SND_OTHER);
  		break;
  	}
 diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index ffaa8b8a0b..151b3a7bfb 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -352,11 +352,11 @@ static BYTE NotifyWithSound(const CEvent &evt)  	if (evt._wDaysLeft <= min(db_get_b(NULL, MODNAME, SET_REMIND_SOUNDOFFSET, DEFVAL_REMIND_SOUNDOFFSET), gRemindOpts.wDaysEarlier)) {
  		switch (evt._eType) {
  		case CEvent::BIRTHDAY:
 -			SkinPlaySound(evt._wDaysLeft == 0 ? SOUND_BIRTHDAY_TODAY : SOUND_BIRTHDAY_SOON);
 +			Skin_PlaySound(evt._wDaysLeft == 0 ? SOUND_BIRTHDAY_TODAY : SOUND_BIRTHDAY_SOON);
  			return 0;
  		case CEvent::ANNIVERSARY:
 -			SkinPlaySound(SOUND_ANNIVERSARY);
 +			Skin_PlaySound(SOUND_ANNIVERSARY);
  			return 0;
  		}
  	}
 @@ -893,24 +893,9 @@ void SvcReminderOnModulesLoaded(void)  void SvcReminderLoadModule(void)
  {
  	// init sounds
 -	SKINSOUNDDESCEX ssd = { 0 };
 -	ssd.cbSize = sizeof(ssd);
 -	ssd.pszSection = MODNAME;
 -
 -	ssd.pszName = SOUND_BIRTHDAY_TODAY;
 -	ssd.pszDescription = LPGEN("Birthday reminder");
 -	ssd.pszDefaultFile = "Sounds\\BirthDay.wav";
 -	Skin_AddSound(&ssd);
 -
 -	ssd.pszName = SOUND_BIRTHDAY_SOON;
 -	ssd.pszDescription = LPGEN("Birthday reminder: it's coming");
 -	ssd.pszDefaultFile = "Sounds\\BirthDayComing.wav";
 -	Skin_AddSound(&ssd);
 -
 -	ssd.pszName = SOUND_ANNIVERSARY;
 -	ssd.pszDescription = LPGEN("Anniversary Reminder");
 -	ssd.pszDefaultFile = "Sounds\\Reminder.wav";
 -	Skin_AddSound(&ssd);
 +	Skin_AddSound(SOUND_BIRTHDAY_TODAY, LPGENW("Birthday reminder"), L"Sounds\\BirthDay.wav");
 +	Skin_AddSound(SOUND_BIRTHDAY_SOON, LPGENW("Birthday reminder: it's coming"), L"Sounds\\BirthDayComing.wav");
 +	Skin_AddSound(SOUND_ANNIVERSARY, LPGENW("Anniversary Reminder"), L"Sounds\\Reminder.wav");
  	// create service functions
  	CreateServiceFunction(MS_USERINFO_REMINDER_CHECK, CheckService);
 @@ -926,7 +911,6 @@ void SvcReminderLoadModule(void)  	if (db_get_b(NULL, MODNAME, SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED) != REMIND_OFF && ExtraIcon == INVALID_HANDLE_VALUE)
  		ExtraIcon = ExtraIcon_RegisterIcolib("Reminder", LPGEN("Reminder (UInfoEx)"), ICO_COMMON_ANNIVERSARY);
 -
  }
  /**
 diff --git a/plugins/Weather/src/weather.cpp b/plugins/Weather/src/weather.cpp index 827b5514eb..94327bc8e4 100644 --- a/plugins/Weather/src/weather.cpp +++ b/plugins/Weather/src/weather.cpp @@ -226,8 +226,8 @@ extern "C" int __declspec(dllexport) Load(void)  	InitServices();
  	// add sound event
 -	SkinAddNewSoundExW("weatherupdated", _A2W(WEATHERPROTONAME), LPGENW("Weather Condition Changed"));
 -	SkinAddNewSoundExW("weatheralert", _A2W(WEATHERPROTONAME), LPGENW("Weather Alert Issued"));
 +	Skin_AddSound("weatherupdated", _A2W(WEATHERPROTONAME), LPGENW("Weather Condition Changed"));
 +	Skin_AddSound("weatheralert", _A2W(WEATHERPROTONAME), LPGENW("Weather Alert Issued"));
  	// window needed for popup commands
  	wchar_t SvcFunc[100];
 diff --git a/plugins/Weather/src/weather_update.cpp b/plugins/Weather/src/weather_update.cpp index 3054f13e3c..02d5129fab 100644 --- a/plugins/Weather/src/weather_update.cpp +++ b/plugins/Weather/src/weather_update.cpp @@ -110,7 +110,7 @@ int UpdateWeather(MCONTACT hContact)  		// alert issued, set display to italic
  		if (opt.MakeItalic)
  			db_set_w(hContact, WEATHERPROTONAME, "ApparentMode", ID_STATUS_OFFLINE);
 -		SkinPlaySound("weatheralert");
 +		Skin_PlaySound("weatheralert");
  	}
  	// alert dropped, set the display back to normal
  	else db_unset(hContact, WEATHERPROTONAME, "ApparentMode");
 @@ -162,7 +162,7 @@ int UpdateWeather(MCONTACT hContact)  	// logging
  	if (Ch) {
  		// play the sound event
 -		SkinPlaySound("weatherupdated");
 +		Skin_PlaySound("weatherupdated");
  		if (db_get_b(hContact, WEATHERPROTONAME, "File", 0)) {
  			// external log
 diff --git a/plugins/WebView/src/main.cpp b/plugins/WebView/src/main.cpp index 2709aa050f..fd897fb380 100644 --- a/plugins/WebView/src/main.cpp +++ b/plugins/WebView/src/main.cpp @@ -164,7 +164,7 @@ extern "C" int __declspec(dllexport) Load()  	InitServices();
  	//add sound event to options
 -	SkinAddNewSoundExW("webviewalert", _A2W(MODULENAME), LPGENW("Alert event"));
 +	Skin_AddSound("webviewalert", _A2W(MODULENAME), LPGENW("Alert event"));
  	//value is 1 if menu is disabled
  	db_set_b(NULL, MODULENAME, MENU_IS_DISABLED_KEY, 1);
 diff --git a/plugins/WebView/src/webview_alerts.cpp b/plugins/WebView/src/webview_alerts.cpp index 2e744c3df8..bdd4551410 100644 --- a/plugins/WebView/src/webview_alerts.cpp +++ b/plugins/WebView/src/webview_alerts.cpp @@ -345,7 +345,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn  					wasAlert = 1;
  					// play sound?
 -					SkinPlaySound("webviewalert");
 +					Skin_PlaySound("webviewalert");
  					//
  					if ((!notpresent)) {
  						if (alertIndex == 0) { // popup
 @@ -443,7 +443,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn  			if (strncmp(tempraw, cachecompare, mir_strlen(tempraw)) != 0) { //lets try this instead
  				// play sound?
 -				SkinPlaySound("webviewalert");
 +				Skin_PlaySound("webviewalert");
  				// there was an alert
  				wasAlert = 1;
 @@ -654,7 +654,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn  				// end write to cache
  				if (strncmp(raw, cachecompare, (mir_strlen(raw))) != 0) { //lets try this instead
  					// play sound?
 -					SkinPlaySound("webviewalert");
 +					Skin_PlaySound("webviewalert");
  					// there was an alert
  					wasAlert = 1;
 diff --git a/plugins/WhenWasIt/src/WhenWasIt.cpp b/plugins/WhenWasIt/src/WhenWasIt.cpp index f6fd93f05f..ee26949b6d 100644 --- a/plugins/WhenWasIt/src/WhenWasIt.cpp +++ b/plugins/WhenWasIt/src/WhenWasIt.cpp @@ -131,8 +131,8 @@ extern "C" int __declspec(dllexport) Load(void)  	hotkey.pszService = MS_WWI_CHECK_BIRTHDAYS;
  	Hotkey_Register(&hotkey);
 -	SkinAddNewSoundExW(BIRTHDAY_NEAR_SOUND, LPGENW("WhenWasIt"), LPGENW("Birthday near"));
 -	SkinAddNewSoundExW(BIRTHDAY_TODAY_SOUND, LPGENW("WhenWasIt"), LPGENW("Birthday today"));
 +	Skin_AddSound(BIRTHDAY_NEAR_SOUND, LPGENW("WhenWasIt"), LPGENW("Birthday near"));
 +	Skin_AddSound(BIRTHDAY_TODAY_SOUND, LPGENW("WhenWasIt"), LPGENW("Birthday today"));
  	Log("%s", "Leaving function " __FUNCTION__);
  	return 0;
 diff --git a/plugins/WhenWasIt/src/notifiers.cpp b/plugins/WhenWasIt/src/notifiers.cpp index 739fbbb789..96bf7fe280 100644 --- a/plugins/WhenWasIt/src/notifiers.cpp +++ b/plugins/WhenWasIt/src/notifiers.cpp @@ -194,9 +194,9 @@ int DialogNotifyMissedBirthday(MCONTACT hContact, int dab, int age)  int SoundNotifyBirthday(int dtb)
  {
  	if (dtb == 0)
 -		SkinPlaySound(BIRTHDAY_TODAY_SOUND);
 +		Skin_PlaySound(BIRTHDAY_TODAY_SOUND);
  	else if (dtb <= commonData.cSoundNearDays)
 -		SkinPlaySound(BIRTHDAY_NEAR_SOUND);
 +		Skin_PlaySound(BIRTHDAY_NEAR_SOUND);
  	return 0;
  }
 diff --git a/plugins/XSoundNotify/src/dialog.cpp b/plugins/XSoundNotify/src/dialog.cpp index bbc972fac2..7c8a3e794c 100644 --- a/plugins/XSoundNotify/src/dialog.cpp +++ b/plugins/XSoundNotify/src/dialog.cpp @@ -137,14 +137,14 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP  				if (!db_get_ws(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
  					wchar_t longpath[MAX_PATH] = { 0 };
  					PathToAbsoluteW(dbv.ptszVal, longpath);
 -					SkinPlaySoundFile(longpath);
 +					Skin_PlaySoundFile(longpath);
  					db_free(&dbv);
  				}
  			}
  			else {
  				wchar_t longpath[MAX_PATH] = { 0 };
  				PathToAbsoluteW(p->path, longpath);
 -				SkinPlaySoundFile(longpath);
 +				Skin_PlaySoundFile(longpath);
  			}
  			break;
 diff --git a/plugins/XSoundNotify/src/options.cpp b/plugins/XSoundNotify/src/options.cpp index f7735d774b..fd5bc06ca8 100644 --- a/plugins/XSoundNotify/src/options.cpp +++ b/plugins/XSoundNotify/src/options.cpp @@ -205,14 +205,14 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l  					if (!db_get_ws(NULL, SETTINGSNAME, pa->szModuleName, &dbv)) {
  						wchar_t longpath[MAX_PATH];
  						PathToAbsoluteW(dbv.ptszVal, longpath);
 -						SkinPlaySoundFile(longpath);
 +						Skin_PlaySoundFile(longpath);
  						db_free(&dbv);
  					}
  				}
  				else {
  					wchar_t longpath[MAX_PATH] = { 0 };
  					PathToAbsoluteW(p->path, longpath);
 -					SkinPlaySoundFile(longpath);
 +					Skin_PlaySoundFile(longpath);
  				}
  			}
  			else {
 @@ -224,14 +224,14 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l  					if (!db_get_ws(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
  						wchar_t longpath[MAX_PATH];
  						PathToAbsoluteW(dbv.ptszVal, longpath);
 -						SkinPlaySoundFile(longpath);
 +						Skin_PlaySoundFile(longpath);
  						db_free(&dbv);
  					}
  				}
  				else {
  					wchar_t longpath[MAX_PATH] = { 0 };
  					PathToAbsoluteW(p->path, longpath);
 -					SkinPlaySoundFile(longpath);
 +					Skin_PlaySoundFile(longpath);
  				}
  			}
  		}
 diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp index b97d930f8d..417dd08dbd 100644 --- a/plugins/XSoundNotify/src/xsn_main.cpp +++ b/plugins/XSoundNotify/src/xsn_main.cpp @@ -78,7 +78,7 @@ void InitSelfSounds()  			wchar_t infobuf[256];
  			mir_snwprintf(infobuf, L"%s [%s]", TranslateT("Self status"), protos[i]->tszAccountName);
 -			SkinAddNewSoundExW(namebuf, infobuf, pcli->pfnGetStatusModeDescription(selfSounds[j].iStatus, 0));
 +			Skin_AddSound(namebuf, infobuf, pcli->pfnGetStatusModeDescription(selfSounds[j].iStatus, 0));
  		}
  	}
  }
 @@ -91,7 +91,7 @@ static int ProtoAck(WPARAM, LPARAM lParam)  			if (selfSounds[i].iStatus == ack->lParam) {
  				char buf[128];
  				mir_snprintf(buf, "%s%s", ack->szModule, selfSounds[i].szName);
 -				SkinPlaySound(buf);
 +				Skin_PlaySound(buf);
  				break;
  			}
  		}
 @@ -121,7 +121,7 @@ static int ProcessEvent(WPARAM hContact, LPARAM lParam)  		wchar_t PlaySoundPath[MAX_PATH] = { 0 };
  		PathToAbsoluteW(dbv.ptszVal, PlaySoundPath);
  		isOwnSound = 0;
 -		SkinPlaySoundFile(PlaySoundPath);
 +		Skin_PlaySoundFile(PlaySoundPath);
  		db_free(&dbv);
  		isOwnSound = 1;
  		return 0;
 @@ -138,7 +138,7 @@ static int ProcessEvent(WPARAM hContact, LPARAM lParam)  		wchar_t PlaySoundPath[MAX_PATH] = { 0 };
  		PathToAbsoluteW(dbv.ptszVal, PlaySoundPath);
  		isAccSound = 0;
 -		SkinPlaySoundFile(PlaySoundPath);
 +		Skin_PlaySoundFile(PlaySoundPath);
  		db_free(&dbv);
  		isAccSound = 1;
  	}
 @@ -168,7 +168,7 @@ static int ProcessChatEvent(WPARAM, LPARAM lParam)  				wchar_t PlaySoundPath[MAX_PATH] = { 0 };
  				PathToAbsoluteW(dbv.ptszVal, PlaySoundPath);
  				isOwnSound = 0;
 -				SkinPlaySoundFile(PlaySoundPath);
 +				Skin_PlaySoundFile(PlaySoundPath);
  				db_free(&dbv);
  				isOwnSound = 1;
  				return 0;
 @@ -184,7 +184,7 @@ static int ProcessChatEvent(WPARAM, LPARAM lParam)  				wchar_t PlaySoundPath[MAX_PATH] = { 0 };
  				PathToAbsoluteW(dbv.ptszVal, PlaySoundPath);
  				isAccSound = 0;
 -				SkinPlaySoundFile(PlaySoundPath);
 +				Skin_PlaySoundFile(PlaySoundPath);
  				db_free(&dbv);
  				isAccSound = 1;
  			}
 diff --git a/plugins/YAMN/src/browser/badconnect.cpp b/plugins/YAMN/src/browser/badconnect.cpp index 31cbb57829..90f5815d4e 100644 --- a/plugins/YAMN/src/browser/badconnect.cpp +++ b/plugins/YAMN/src/browser/badconnect.cpp @@ -245,7 +245,7 @@ void __cdecl BadConnection(void *Param)  		DebugLog(SynchroFile,"BadConnect:ActualAccountSO-read enter\n");
  #endif
  		if (ActualAccount->BadConnectN.Flags & YAMN_ACC_SND)
 -			CallService(MS_SKIN_PLAYSOUND, 0, (LPARAM)YAMN_CONNECTFAILSOUND);
 +			Skin_PlaySound(YAMN_CONNECTFAILSOUND);
  		if (ActualAccount->BadConnectN.Flags & YAMN_ACC_MSG)
  			ShowWindow(hBadConnect, SW_SHOWNORMAL);
 diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp index 64b7508f92..9342ecc1aa 100644 --- a/plugins/YAMN/src/browser/mailbrowser.cpp +++ b/plugins/YAMN/src/browser/mailbrowser.cpp @@ -741,7 +741,7 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D  	if (MN->Real.SoundNC + MN->Virtual.SoundNC != 0)  		if (nflags & YAMN_ACC_SND) -			SkinPlaySound(YAMN_NEWMAILSOUND); +			Skin_PlaySound(YAMN_NEWMAILSOUND);  	if ((nnflags & YAMN_ACC_POP) && (MN->Real.PopupRun + MN->Virtual.PopupRun == 0)) {  		POPUPDATAT NoNewMailPopup; diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp index d13f61a6ba..9264edaf70 100644 --- a/plugins/YAMN/src/main.cpp +++ b/plugins/YAMN/src/main.cpp @@ -324,8 +324,8 @@ extern "C" int __declspec(dllexport) Load(void)  	CreateServiceFunctions(); -	SkinAddNewSoundEx(YAMN_NEWMAILSOUND, YAMN_DBMODULE, YAMN_NEWMAILSNDDESC); -	SkinAddNewSoundEx(YAMN_CONNECTFAILSOUND, YAMN_DBMODULE, YAMN_CONNECTFAILSNDDESC); +	Skin_AddSound(YAMN_NEWMAILSOUND,  L"YAMN", YAMN_NEWMAILSNDDESC); +	Skin_AddSound(YAMN_CONNECTFAILSOUND, L"YAMN", YAMN_CONNECTFAILSNDDESC);  	HookEvents(); diff --git a/plugins/YAMN/src/main.h b/plugins/YAMN/src/main.h index eacb470e69..fd09d77b13 100644 --- a/plugins/YAMN/src/main.h +++ b/plugins/YAMN/src/main.h @@ -1,8 +1,8 @@  #ifndef __MAIN_H
  #define __MAIN_H
 -#define YAMN_NEWMAILSNDDESC		LPGEN("YAMN: new mail message")
 -#define YAMN_CONNECTFAILSNDDESC	LPGEN("YAMN: connect failed")
 +#define YAMN_NEWMAILSNDDESC		LPGENW("YAMN: new mail message")
 +#define YAMN_CONNECTFAILSNDDESC	LPGENW("YAMN: connect failed")
  #define	YAMN_CONNECTFAILSOUND	"YAMN/Sound/ConnectFail"
  #define	YAMN_NEWMAILSOUND		"YAMN/Sound/NewMail"
 diff --git a/protocols/FacebookRM/src/events.cpp b/protocols/FacebookRM/src/events.cpp index f46ad30d58..13129f43f3 100644 --- a/protocols/FacebookRM/src/events.cpp +++ b/protocols/FacebookRM/src/events.cpp @@ -41,22 +41,22 @@ HWND FacebookProto::NotifyEvent(wchar_t* title, wchar_t* text, MCONTACT contact,  	case EVENT_NOTIFICATION:  		mir_snprintf(name, "%s_%s", m_szModuleName, "Notification"); -		SkinPlaySound("Notification"); +		Skin_PlaySound("Notification");  		break;  	case EVENT_OTHER:  		mir_snprintf(name, "%s_%s", m_szModuleName, "Other"); -		SkinPlaySound("OtherEvent"); +		Skin_PlaySound("OtherEvent");  		break;  	case EVENT_FRIENDSHIP:  		mir_snprintf(name, "%s_%s", m_szModuleName, "Friendship"); -		SkinPlaySound("Friendship"); +		Skin_PlaySound("Friendship");  		break;  	case EVENT_TICKER:  		mir_snprintf(name, "%s_%s", m_szModuleName, "Ticker"); -		SkinPlaySound("Ticker"); +		Skin_PlaySound("Ticker");  		break;  	case EVENT_ON_THIS_DAY: diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp index 2a60d15060..297576d219 100644 --- a/protocols/FacebookRM/src/process.cpp +++ b/protocols/FacebookRM/src/process.cpp @@ -695,7 +695,7 @@ void FacebookProto::ProcessMemories(void *p)  			parseFeeds(html, news, new_time, true);  			if (!news.empty()) { -				SkinPlaySound("Memories"); +				Skin_PlaySound("Memories");  			}  			numMemories = news.size(); @@ -1176,7 +1176,7 @@ void FacebookProto::ProcessFeeds(void *p)  	parseFeeds(resp.data, news, new_time, filterAds);  	if (!news.empty()) { -		SkinPlaySound("NewsFeed"); +		Skin_PlaySound("NewsFeed");  	}  	if (manuallyTriggered) { diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index 0490710df1..27be2e50d6 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -1120,12 +1120,12 @@ void FacebookProto::InitHotkeys()   */  void FacebookProto::InitSounds()  { -	SkinAddNewSoundExW("Notification", m_tszUserName, LPGENW("Notification")); -	SkinAddNewSoundExW("NewsFeed", m_tszUserName, LPGENW("Newsfeed event")); -	SkinAddNewSoundExW("OtherEvent", m_tszUserName, LPGENW("Other event")); -	SkinAddNewSoundExW("Friendship", m_tszUserName, LPGENW("Friendship event")); -	SkinAddNewSoundExW("Ticker", m_tszUserName, LPGENW("Ticker event")); -	SkinAddNewSoundExW("Memories", m_tszUserName, LPGENW("Memories")); +	Skin_AddSound("Notification", m_tszUserName, LPGENW("Notification")); +	Skin_AddSound("NewsFeed", m_tszUserName, LPGENW("Newsfeed event")); +	Skin_AddSound("OtherEvent", m_tszUserName, LPGENW("Other event")); +	Skin_AddSound("Friendship", m_tszUserName, LPGENW("Friendship event")); +	Skin_AddSound("Ticker", m_tszUserName, LPGENW("Ticker event")); +	Skin_AddSound("Memories", m_tszUserName, LPGENW("Memories"));  }  /** diff --git a/protocols/MRA/src/MraConstans.h b/protocols/MRA/src/MraConstans.h index ab2eb18dc0..406f471c27 100644 --- a/protocols/MRA/src/MraConstans.h +++ b/protocols/MRA/src/MraConstans.h @@ -119,7 +119,7 @@ static const LPSTR lpcszMailRuDomains[] =  #define ADV_ICON_BLOGSTATUS_ID               "ADV_ICON_BLOGSTATUS"
  #define ADV_ICON_BLOGSTATUS_STR              LPGEN("Blog status message")
 -#define MRA_SOUND_NEW_EMAIL                   LPGEN("New E-mail available in Inbox")
 +#define MRA_SOUND_NEW_EMAIL                   LPGENW("New E-mail available in Inbox")
  #define MAILRU_SERVER_TIME_ZONE              -180 //internal // +0300
  #define MAILRU_CONTACTISTYPING_TIMEOUT       10 //internal
 diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp index 4ced9192fc..ca19b6290a 100644 --- a/protocols/MRA/src/MraProto.cpp +++ b/protocols/MRA/src/MraProto.cpp @@ -47,7 +47,7 @@ CMraProto::CMraProto(const char* _module, const wchar_t* _displayName) :  	InitMenus();
  	mir_snprintf(szNewMailSound, "%s_new_email", m_szModuleName);
 -	SkinAddNewSoundEx(szNewMailSound, m_szModuleName, MRA_SOUND_NEW_EMAIL);
 +	Skin_AddSound(szNewMailSound, m_tszUserName, MRA_SOUND_NEW_EMAIL);
  	HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &CMraProto::MraRebuildStatusMenu);
 diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index 928efc9328..bf8dea15bb 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -663,7 +663,7 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA &  			pcli->pfnAddEvent(&cle);
  		}
 -		SkinPlaySound(szNewMailSound);
 +		Skin_PlaySound(szNewMailSound);
  		if (hContact) {// update user info
  			MraUpdateContactInfo(hContact);
  			MraPopupShowFromContactW(hContact, MRA_POPUP_TYPE_EMAIL_STATUS, szStatusText);
 diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp index f8662107a3..2f7d21d088 100644 --- a/protocols/MSN/src/msn_commands.cpp +++ b/protocols/MSN/src/msn_commands.cpp @@ -718,7 +718,7 @@ void CMsnProto::MSN_ProcessNotificationMessage(char* buf, size_t len)  		mir_snprintf((fullurl + sz), (_countof(fullurl) - sz), "notification_id=%s&message_id=%s",
  			ezxml_attr(xmlnot, "id"), ezxml_attr(xmlmsg, "id"));
 -		SkinPlaySound(alertsoundname);
 +		Skin_PlaySound(alertsoundname);
  		wchar_t* alrt = mir_utf8decodeW(ezxml_txt(xmltxt));
  		MSN_ShowPopup(TranslateT("MSN Alert"), alrt, MSN_ALERT_POPUP | MSN_ALLOW_MSGBOX, fullurl);
 diff --git a/protocols/MSN/src/msn_mail.cpp b/protocols/MSN/src/msn_mail.cpp index dd385c6070..7bc2b7fb33 100644 --- a/protocols/MSN/src/msn_mail.cpp +++ b/protocols/MSN/src/msn_mail.cpp @@ -304,7 +304,7 @@ void CMsnProto::sttNotificationMessage(char* msgBody, bool isInitial)  	// Disable to notify receiving hotmail
  	if (ShowPopup && !getByte("DisableHotmail", 0)) {
 -		SkinPlaySound(mailsoundname);
 +		Skin_PlaySound(mailsoundname);
  		const char *msgurl = tFileInfo["Message-URL"];
  		if (msgurl) {
 diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index 57e190da30..dbce865552 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -114,11 +114,11 @@ CMsnProto::CMsnProto(const char* aProtoName, const wchar_t* aUserName) :  	mailsoundname = (char*)mir_alloc(64);
  	mir_snprintf(mailsoundname, 64, "%s:Hotmail", m_szModuleName);
 -	SkinAddNewSoundExW(mailsoundname, m_tszUserName, LPGENW("Live Mail"));
 +	Skin_AddSound(mailsoundname, m_tszUserName, LPGENW("Live Mail"));
  	alertsoundname = (char*)mir_alloc(64);
  	mir_snprintf(alertsoundname, 64, "%s:Alerts", m_szModuleName);
 -	SkinAddNewSoundExW(alertsoundname, m_tszUserName, LPGENW("Live Alert"));
 +	Skin_AddSound(alertsoundname, m_tszUserName, LPGENW("Live Alert"));
  	AvatarQueue_Init();
  	InitCustomFolders();
 diff --git a/protocols/Omegle/src/communication.cpp b/protocols/Omegle/src/communication.cpp index 32e0d891df..8e8f69e2cf 100644 --- a/protocols/Omegle/src/communication.cpp +++ b/protocols/Omegle/src/communication.cpp @@ -555,7 +555,7 @@ bool Omegle_client::events()  			}  			else if (name == "typing" || name == "spyTyping") {  				// Stranger is typing, not supported by chat module yet -				SkinPlaySound("StrangerTyp"); +				Skin_PlaySound("StrangerTyp");  				ptrW who(name == "spyTyping" ? json_as_string(json_at(item, 1)) : mir_wstrdup(L"Stranger"));  				Srmm_SetStatusText(parent->GetChatHandle(),  @@ -564,7 +564,7 @@ bool Omegle_client::events()  			}  			else if (name == "stoppedTyping" || name == "spyStoppedTyping") {  				// Stranger stopped typing, not supported by chat module yet -				SkinPlaySound("StrangerTypStop"); +				Skin_PlaySound("StrangerTypStop");  				ptrW who(name == "spyTyping" ? json_as_string(json_at(item, 1)) : mir_wstrdup(L"Stranger"));  				Srmm_SetStatusText(parent->GetChatHandle(),  @@ -575,7 +575,7 @@ bool Omegle_client::events()  				Srmm_SetStatusText(parent->GetChatHandle(), nullptr);  				// Play sound as we received message -				SkinPlaySound("StrangerMessage"); +				Skin_PlaySound("StrangerMessage");  				if (state_ == STATE_ACTIVE) {  					ptrW msg(json_as_string(json_at(item, 1))); @@ -586,7 +586,7 @@ bool Omegle_client::events()  				Srmm_SetStatusText(parent->GetChatHandle(), nullptr);  				// Play sound as we received message -				SkinPlaySound("StrangerMessage"); +				Skin_PlaySound("StrangerMessage");  				if (state_ == STATE_SPY) {  					ptrW stranger(json_as_string(json_at(item, 1))); @@ -600,7 +600,7 @@ bool Omegle_client::events()  				// Stranger disconnected  				if (db_get_b(NULL, parent->m_szModuleName, OMEGLE_KEY_DONT_STOP, 0))  				{ -					SkinPlaySound("StrangerChange"); +					Skin_PlaySound("StrangerChange");  					parent->NewChat();  				}  				else @@ -618,7 +618,7 @@ bool Omegle_client::events()  				// Stranger disconnected  				if (db_get_b(NULL, parent->m_szModuleName, OMEGLE_KEY_DONT_STOP, 0))  				{ -					SkinPlaySound("StrangerChange"); +					Skin_PlaySound("StrangerChange");  					parent->NewChat();  				}  				else diff --git a/protocols/Omegle/src/proto.cpp b/protocols/Omegle/src/proto.cpp index 3eae533cda..aa46bbc601 100644 --- a/protocols/Omegle/src/proto.cpp +++ b/protocols/Omegle/src/proto.cpp @@ -57,10 +57,10 @@ PROTO<OmegleProto>(proto_name, username)  	facy.set_handle(m_hNetlibUser);
 -	SkinAddNewSoundExW("StrangerTyp", m_tszUserName, LPGENW("Stranger is typing"));
 -	SkinAddNewSoundExW("StrangerTypStop", m_tszUserName, LPGENW("Stranger stopped typing"));
 -	SkinAddNewSoundExW("StrangerChange", m_tszUserName, LPGENW("Changing stranger"));
 -	SkinAddNewSoundExW("StrangerMessage", m_tszUserName, LPGENW("Receive message"));
 +	Skin_AddSound("StrangerTyp", m_tszUserName, LPGENW("Stranger is typing"));
 +	Skin_AddSound("StrangerTypStop", m_tszUserName, LPGENW("Stranger stopped typing"));
 +	Skin_AddSound("StrangerChange", m_tszUserName, LPGENW("Changing stranger"));
 +	Skin_AddSound("StrangerMessage", m_tszUserName, LPGENW("Receive message"));
  }
  OmegleProto::~OmegleProto()
 diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp index cc90e0d25b..e6d76d9e10 100644 --- a/protocols/SkypeWeb/src/skype_proto.cpp +++ b/protocols/SkypeWeb/src/skype_proto.cpp @@ -48,8 +48,8 @@ CSkypeProto::CSkypeProto(const char* protoName, const wchar_t* userName) :  		CreateDirectoryTreeW(m_tszAvatarFolder.c_str());  	//sounds -	SkinAddNewSoundEx("skype_inc_call", "SkypeWeb", LPGEN("Incoming call sound")); -	SkinAddNewSoundEx("skype_call_canceled", "SkypeWeb", LPGEN("Incoming call canceled sound")); +	Skin_AddSound("skype_inc_call", L"SkypeWeb", LPGENW("Incoming call sound")); +	Skin_AddSound("skype_call_canceled", L"SkypeWeb", LPGENW("Incoming call canceled sound"));  	SkypeSetTimer(); diff --git a/protocols/SkypeWeb/src/skype_trouter.cpp b/protocols/SkypeWeb/src/skype_trouter.cpp index 668431554b..a34e35c8e9 100644 --- a/protocols/SkypeWeb/src/skype_trouter.cpp +++ b/protocols/SkypeWeb/src/skype_trouter.cpp @@ -187,7 +187,7 @@ void CSkypeProto::OnTrouterEvent(const JSONNode &body, const JSONNode &)  				MCONTACT hContact = AddContact(uid.c_str(), true);
  				MEVENT hEvent = AddDbEvent(SKYPE_DB_EVENT_TYPE_INCOMING_CALL, hContact, time(NULL), DBEF_READ, gp.c_str(), callId.c_str());
 -				SkinPlaySound("skype_inc_call");
 +				Skin_PlaySound("skype_inc_call");
  				CLISTEVENT cle = {};
  				cle.flags = CLEF_UNICODE;
 @@ -210,7 +210,7 @@ void CSkypeProto::OnTrouterEvent(const JSONNode &body, const JSONNode &)  	case 104: //call canceled: callerId=""; conversationId=NULL; callId=call id
  		// std::string callId = body["callId"].as_string();
 -		SkinPlaySound("skype_call_canceled");
 +		Skin_PlaySound("skype_call_canceled");
  		break;
  	}
  }
 diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp index 34f6828abf..db1a4bbfb1 100644 --- a/protocols/Tlen/src/tlen.cpp +++ b/protocols/Tlen/src/tlen.cpp @@ -230,19 +230,14 @@ INT_PTR TlenProtocol::MenuHandleInbox(WPARAM, LPARAM)  int TlenProtocol::OnModulesLoaded(WPARAM, LPARAM)
  {
 -	char str[128];
  	/* Set all contacts to offline */
 -
  	for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
  		if (db_get_w(hContact, m_szModuleName, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
  			db_set_w(hContact, m_szModuleName, "Status", ID_STATUS_OFFLINE);
 -	strncpy_s(str, LPGEN("Incoming mail"), _TRUNCATE);
 -	SkinAddNewSoundEx("TlenMailNotify", m_szModuleName, str);
 -	strncpy_s(str, LPGEN("Alert"), _TRUNCATE);
 -	SkinAddNewSoundEx("TlenAlertNotify", m_szModuleName, str);
 -	strncpy_s(str, LPGEN("Voice chat"), _TRUNCATE);
 -	SkinAddNewSoundEx("TlenVoiceNotify", m_szModuleName, str);
 +	Skin_AddSound("TlenMailNotify", m_tszUserName, LPGENW("Incoming mail"));
 +	Skin_AddSound("TlenAlertNotify", m_tszUserName, LPGENW("Alert"));
 +	Skin_AddSound("TlenVoiceNotify", m_tszUserName, LPGENW("Voice chat"));
  	HookProtoEvent(ME_USERINFO_INITIALISE, &TlenProtocol::UserInfoInit);
  	return 0;
 diff --git a/protocols/Tlen/src/tlen_thread.cpp b/protocols/Tlen/src/tlen_thread.cpp index 2528b62f9e..8396a9ab45 100644 --- a/protocols/Tlen/src/tlen_thread.cpp +++ b/protocols/Tlen/src/tlen_thread.cpp @@ -991,7 +991,7 @@ static void TlenProcessM(XmlNode *node, ThreadData *info)  						else {
  							if (info->proto->tlenOptions.logAlerts)
  								TlenLogMessage(info->proto, hContact, 0, Translate("An alert has been received."));
 -							SkinPlaySound("TlenAlertNotify");
 +							Skin_PlaySound("TlenAlertNotify");
  						}
  					}
  				}
 @@ -1107,7 +1107,7 @@ static void TlenProcessN(XmlNode *node, ThreadData *info)  		TlenStringAppend(&str, &strSize, "%s: %s", Translate("Subject"), s);
  		popupText = TlenTextDecode(str);
  		TlenMailPopup(info->proto, popupTitle, popupText);
 -		SkinPlaySound("TlenMailNotify");
 +		Skin_PlaySound("TlenMailNotify");
  		mir_free(popupTitle);
  		mir_free(popupText);
 @@ -1211,7 +1211,7 @@ static void TlenProcessV(XmlNode *node, ThreadData *info)  		if ((e=TlenXmlGetAttrValue(node, "e")) != NULL) {
  			if (!mir_strcmp(e, "1")) {
  				if ((id=TlenXmlGetAttrValue(node, "i")) != NULL) {
 -					SkinPlaySound("TlenVoiceNotify");
 +					Skin_PlaySound("TlenVoiceNotify");
  					TlenVoiceAccept(info->proto, id, from);
  				}
  			} else if (!mir_strcmp(e, "3")) {
 diff --git a/protocols/Twitter/src/connection.cpp b/protocols/Twitter/src/connection.cpp index 21c7ce6cb9..3e399e6e5e 100644 --- a/protocols/Twitter/src/connection.cpp +++ b/protocols/Twitter/src/connection.cpp @@ -589,7 +589,7 @@ void TwitterProto::UpdateStatuses(bool pre_read, bool popups, bool tweetToMsg)  			if (!pre_read && popups) {
  				std::stringstream url;
  				url << std::string("https://twitter.com/") << i->username << std::string("/status/") << i->status.id;
 -				SkinPlaySound("TwitterNew");
 +				Skin_PlaySound("TwitterNew");
  				ShowContactPopup(hContact, i->status.text, new std::string(url.str()));
  			}
  		}
 diff --git a/protocols/Twitter/src/contacts.cpp b/protocols/Twitter/src/contacts.cpp index c0bcddb4f5..9c9f6f4d50 100644 --- a/protocols/Twitter/src/contacts.cpp +++ b/protocols/Twitter/src/contacts.cpp @@ -249,7 +249,7 @@ MCONTACT TwitterProto::AddToClientList(const char *name, const char *status)  			std::string url = profile_base_url("https://twitter.com/") + http::url_encode(name);
  			setString(hContact, "Homepage", url.c_str());
 -			SkinPlaySound("TwitterNewContact");
 +			Skin_PlaySound("TwitterNewContact");
  			DBVARIANT dbv;
  			if (!getWString(TWITTER_KEY_GROUP, &dbv)) {
  				db_set_ws(hContact, "CList", "Group", dbv.ptszVal);
 diff --git a/protocols/Twitter/src/theme.cpp b/protocols/Twitter/src/theme.cpp index 1040df4819..a32b8e6e46 100644 --- a/protocols/Twitter/src/theme.cpp +++ b/protocols/Twitter/src/theme.cpp @@ -33,8 +33,8 @@ static IconItem icons[] =  void TwitterInitSounds(void)
  {
 -	SkinAddNewSoundEx("TwitterNewContact", LPGEN("Twitter"), LPGEN("First tweet from new contact"));
 -	SkinAddNewSoundEx("TwitterNew", LPGEN("Twitter"), LPGEN("New tweet"));
 +	Skin_AddSound("TwitterNewContact", LPGENW("Twitter"), LPGENW("First tweet from new contact"));
 +	Skin_AddSound("TwitterNew",        LPGENW("Twitter"), LPGENW("New tweet"));
  }
  // TODO: uninit
 diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp index 1ee8c9bae9..64654c3813 100644 --- a/protocols/VKontakte/src/vk_feed.cpp +++ b/protocols/VKontakte/src/vk_feed.cpp @@ -71,7 +71,7 @@ void CVkProto::AddFeedEvent(CVKNewsItem& vkNewsItem)  void CVkProto::AddCListEvent(bool bNews)
  {
 -	SkinPlaySound("VKNewsFeed");
 +	Skin_PlaySound("VKNewsFeed");
  	if (!m_vkOptions.bUseNonStandardNotifications)
  		return;
 diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index fbfea1b4c1..dec31de534 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -121,7 +121,7 @@ int CVkProto::OnModulesLoaded(WPARAM, LPARAM)  	HookProtoEvent(ME_DB_EVENT_MARKED_READ, &CVkProto::OnDbEventRead);
  	HookProtoEvent(ME_DB_CONTACT_SETTINGCHANGED, &CVkProto::OnDbSettingChanged);
  	//Sounds
 -	SkinAddNewSoundExW("VKNewsFeed", m_tszUserName, LPGENW("VKontakte newsfeed & notification event"));
 +	Skin_AddSound("VKNewsFeed", m_tszUserName, LPGENW("VKontakte newsfeed & notification event"));
  	InitPopups();
  	InitMenus();
 diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp index c41266f98c..3d19f7fe72 100644 --- a/protocols/WhatsApp/src/proto.cpp +++ b/protocols/WhatsApp/src/proto.cpp @@ -399,7 +399,7 @@ void WhatsAppProto::NotifyEvent(const wchar_t *title, const wchar_t *info, MCONT  			colorText = getDword(WHATSAPP_KEY_EVENT_OTHER_COLTEXT, DEFAULT_EVENT_COLTEXT);
  		}
  		timeout = getDword(WHATSAPP_KEY_EVENT_OTHER_TIMEOUT, -1);
 -		SkinPlaySound("OtherEvent");
 +		Skin_PlaySound("OtherEvent");
  		flags |= NIIF_INFO;
  		break;
  	}
 diff --git a/src/core/stdauth/src/auth.cpp b/src/core/stdauth/src/auth.cpp index e7074b4dbb..7b5b3ae59b 100644 --- a/src/core/stdauth/src/auth.cpp +++ b/src/core/stdauth/src/auth.cpp @@ -68,7 +68,7 @@ static int AuthEventAdded(WPARAM, LPARAM lParam)  	ptrW szUid(Contact_GetInfo(CNF_UNIQUEID, hContact));
  	if (dbei.eventType == EVENTTYPE_AUTHREQUEST) {
 -		SkinPlaySound("AuthRequest");
 +		Skin_PlaySound("AuthRequest");
  		if (szUid)
  			mir_snwprintf(szTooltip, TranslateT("%s requests authorization"), szUid);
  		else
 @@ -79,7 +79,7 @@ static int AuthEventAdded(WPARAM, LPARAM lParam)  		pcli->pfnAddEvent(&cli);
  	}
  	else if (dbei.eventType == EVENTTYPE_ADDED) {
 -		SkinPlaySound("AddedEvent");
 +		Skin_PlaySound("AddedEvent");
  		if (szUid)
  			mir_snwprintf(szTooltip, TranslateT("%s added you to their contact list"), szUid);
  		else
 @@ -98,7 +98,7 @@ int LoadSendRecvAuthModule(void)  	CreateServiceFunction(MS_AUTH_SHOWADDED, ShowAddedWindow);
  	HookEvent(ME_DB_EVENT_ADDED, AuthEventAdded);
 -	SkinAddNewSoundEx("AuthRequest", LPGEN("Alerts"), LPGEN("Authorization request"));
 -	SkinAddNewSoundEx("AddedEvent", LPGEN("Alerts"), LPGEN("Added event"));
 +	Skin_AddSound("AuthRequest", LPGENW("Alerts"), LPGENW("Authorization request"));
 +	Skin_AddSound("AddedEvent", LPGENW("Alerts"), LPGENW("Added event"));
  	return 0;
  }
 diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp index bc68940dd9..3d391dd7a7 100644 --- a/src/core/stdfile/src/file.cpp +++ b/src/core/stdfile/src/file.cpp @@ -105,7 +105,7 @@ void PushFileEvent(MCONTACT hContact, MEVENT hdbe, LPARAM lParam)  		CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_FILERECV), NULL, DlgProcRecvFile, (LPARAM)&cle);
  	}
  	else {
 -		SkinPlaySound("RecvFile");
 +		Skin_PlaySound("RecvFile");
  		wchar_t szTooltip[256];
  		mir_snwprintf(szTooltip, TranslateT("File from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
 @@ -443,9 +443,9 @@ int LoadSendRecvFileModule(void)  	CreateServiceFunction("SRFile/OpenContRecDir", openContRecDir);
  	CreateServiceFunction("SRFile/OpenRecDir", openRecDir);
 -	SkinAddNewSoundEx("RecvFile", LPGEN("File"), LPGEN("Incoming"));
 -	SkinAddNewSoundEx("FileDone", LPGEN("File"), LPGEN("Complete"));
 -	SkinAddNewSoundEx("FileFailed", LPGEN("File"), LPGEN("Error"));
 -	SkinAddNewSoundEx("FileDenied", LPGEN("File"), LPGEN("Denied"));
 +	Skin_AddSound("RecvFile",   LPGENW("File"), LPGENW("Incoming"));
 +	Skin_AddSound("FileDone",   LPGENW("File"), LPGENW("Complete"));
 +	Skin_AddSound("FileFailed", LPGENW("File"), LPGENW("Error"));
 +	Skin_AddSound("FileDenied", LPGENW("File"), LPGENW("Denied"));
  	return 0;
  }
 diff --git a/src/core/stdfile/src/filerecvdlg.cpp b/src/core/stdfile/src/filerecvdlg.cpp index 7a9edaad87..5f6baa2e04 100644 --- a/src/core/stdfile/src/filerecvdlg.cpp +++ b/src/core/stdfile/src/filerecvdlg.cpp @@ -388,7 +388,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l  				EnableWindow(GetDlgItem(hwndDlg, IDC_FILEDIR), FALSE);
  				EnableWindow(GetDlgItem(hwndDlg, IDC_FILEDIRBROWSE), FALSE);
  				SetDlgItemText(hwndDlg, IDC_MSG, TranslateT("This file transfer has been canceled by the other side"));
 -				SkinPlaySound("FileDenied");
 +				Skin_PlaySound("FileDenied");
  				FlashWindow(hwndDlg, TRUE);
  			}
  			else if (ack->result != ACKRESULT_FILERESUME)
 diff --git a/src/core/stdfile/src/filexferdlg.cpp b/src/core/stdfile/src/filexferdlg.cpp index ed875004c1..d3499bfcb8 100644 --- a/src/core/stdfile/src/filexferdlg.cpp +++ b/src/core/stdfile/src/filexferdlg.cpp @@ -624,16 +624,16 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR  				if (ack->result == ACKRESULT_DENIED) {  					dat->fs = NULL; /* protocol will free structure */ -					SkinPlaySound("FileDenied"); +					Skin_PlaySound("FileDenied");  					SetFtStatus(hwndDlg, LPGENW("File transfer denied"), FTS_TEXT);  				}  				else if (ack->result == ACKRESULT_FAILED) {  					dat->fs = NULL; /* protocol will free structure */ -					SkinPlaySound("FileFailed"); +					Skin_PlaySound("FileFailed");  					SetFtStatus(hwndDlg, LPGENW("File transfer failed"), FTS_TEXT);  				}  				else { -					SkinPlaySound("FileDone"); +					Skin_PlaySound("FileDone");  					if (dat->send) {  						dat->fs = NULL; /* protocol will free structure */  						SetFtStatus(hwndDlg, LPGENW("Transfer completed."), FTS_TEXT); diff --git a/src/core/stdmsg/src/globals.cpp b/src/core/stdmsg/src/globals.cpp index 4675677588..661837a1b2 100644 --- a/src/core/stdmsg/src/globals.cpp +++ b/src/core/stdmsg/src/globals.cpp @@ -87,7 +87,7 @@ static int ackevent(WPARAM, LPARAM lParam)  		msgQueue_processack(pAck->hContact, (INT_PTR)pAck->hProcess, pAck->result == ACKRESULT_SUCCESS, (char*)pAck->lParam);
  		if (pAck->result == ACKRESULT_SUCCESS)
 -			SkinPlaySound("SendMsg");
 +			Skin_PlaySound("SendMsg");
  	}
  	return 0;
  }
 diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 7f418e285d..e3834976ff 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -1148,9 +1148,9 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)  				// Sounds *only* for sent messages, not for custom events
  				if (isMessage && !isSent) {
  					if (GetForegroundWindow() == m_pOwner->GetHwnd())
 -						SkinPlaySound("RecvMsgActive");
 +						Skin_PlaySound("RecvMsgActive");
  					else
 -						SkinPlaySound("RecvMsgInactive");
 +						Skin_PlaySound("RecvMsgInactive");
  				}
  				if (isMessage && !isSent) {
  					m_lastMessage = dbei.timestamp;
 diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 7df2891d00..1b2fa2a775 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -72,18 +72,18 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam)  			ShowWindow(hwnd, SW_RESTORE);
  			SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
  			SetForegroundWindow(hwnd);
 -			SkinPlaySound("RecvMsgActive");
 +			Skin_PlaySound("RecvMsgActive");
  		}
  		else {
  			if (GetForegroundWindow() == GetParent(hwnd))
 -				SkinPlaySound("RecvMsgActive");
 +				Skin_PlaySound("RecvMsgActive");
  			else
 -				SkinPlaySound("RecvMsgInactive");
 +				Skin_PlaySound("RecvMsgInactive");
  		}
  		return 0;
  	}
  	/* new message */
 -	SkinPlaySound("AlertMsg");
 +	Skin_PlaySound("AlertMsg");
  	char *szProto = GetContactProto(hContact);
  	if (szProto && (g_dat.openFlags & SRMMStatusToPf2(CallProtoService(szProto, PS_GETSTATUS, 0, 0)))) {
 @@ -164,7 +164,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam)  	hContact = db_mc_tryMeta(hContact);
 -	SkinPlaySound((lParam) ? "TNStart" : "TNStop");
 +	Skin_PlaySound((lParam) ? "TNStart" : "TNStop");
  	HWND hwnd = Srmm_FindWindow(hContact);
  	if (hwnd)
 @@ -511,13 +511,13 @@ int LoadSendRecvMessageModule(void)  	CreateServiceFunction(MS_MSG_SENDMESSAGEW, SendMessageCommand_W);
  	CreateServiceFunction(MS_MSG_READMESSAGE, ReadMessageCommand);
 -	SkinAddNewSoundEx("RecvMsgActive", LPGEN("Instant messages"), LPGEN("Incoming (focused window)"));
 -	SkinAddNewSoundEx("RecvMsgInactive", LPGEN("Instant messages"), LPGEN("Incoming (unfocused window)"));
 -	SkinAddNewSoundEx("AlertMsg", LPGEN("Instant messages"), LPGEN("Incoming (new session)"));
 -	SkinAddNewSoundEx("SendMsg", LPGEN("Instant messages"), LPGEN("Outgoing"));
 -	SkinAddNewSoundEx("SendError", LPGEN("Instant messages"), LPGEN("Message send error"));
 -	SkinAddNewSoundEx("TNStart", LPGEN("Instant messages"), LPGEN("Contact started typing"));
 -	SkinAddNewSoundEx("TNStop", LPGEN("Instant messages"), LPGEN("Contact stopped typing"));
 +	Skin_AddSound("RecvMsgActive",   LPGENW("Instant messages"), LPGENW("Incoming (focused window)"));
 +	Skin_AddSound("RecvMsgInactive", LPGENW("Instant messages"), LPGENW("Incoming (unfocused window)"));
 +	Skin_AddSound("AlertMsg",        LPGENW("Instant messages"), LPGENW("Incoming (new session)"));
 +	Skin_AddSound("SendMsg",         LPGENW("Instant messages"), LPGENW("Outgoing"));
 +	Skin_AddSound("SendError",       LPGENW("Instant messages"), LPGENW("Message send error"));
 +	Skin_AddSound("TNStart",         LPGENW("Instant messages"), LPGENW("Contact started typing"));
 +	Skin_AddSound("TNStop",          LPGENW("Instant messages"), LPGENW("Contact stopped typing"));
  	InitStatusIcons();
  	return 0;
 diff --git a/src/core/stdmsg/src/msgtimedout.cpp b/src/core/stdmsg/src/msgtimedout.cpp index 7596198ce5..e0ce1ad97c 100644 --- a/src/core/stdmsg/src/msgtimedout.cpp +++ b/src/core/stdmsg/src/msgtimedout.cpp @@ -93,7 +93,7 @@ void MessageFailureProcess(TMsgQueue *item, const char* err)  	}
  	else SendMessage(hwnd, DM_REMAKELOG, 0, 0);
 -	SkinPlaySound("SendError");
 +	Skin_PlaySound("SendError");
  	ErrorDlgParam param = { err, item };
  	CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSGSENDERROR), hwnd, ErrorDlgProc, (LPARAM)¶m);
 diff --git a/src/core/stduseronline/src/useronline.cpp b/src/core/stduseronline/src/useronline.cpp index 3ac251408d..b7ff2473b0 100644 --- a/src/core/stduseronline/src/useronline.cpp +++ b/src/core/stduseronline/src/useronline.cpp @@ -65,7 +65,7 @@ static int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam)  				pcli->pfnAddEvent(&cle);
  				IcoLib_ReleaseIcon(cle.hIcon, 0);
                  db_set_dw(cle.hContact, "UserOnline", "LastEvent", (DWORD)cle.hDbEvent);
 -				SkinPlaySound("UserOnline");
 +				Skin_PlaySound("UserOnline");
  			}
  		}
  	}
 @@ -117,6 +117,6 @@ int LoadUserOnlineModule(void)  	HookEvent(ME_PROTO_ACK, UserOnlineAck);
  	HookEvent(ME_SYSTEM_MODULESLOADED, UserOnlineModulesLoaded);
  	HookEvent(ME_PROTO_ACCLISTCHANGED, UserOnlineAccountsChanged);
 -	SkinAddNewSoundEx("UserOnline", LPGEN("Alerts"), LPGEN("Online"));
 +	Skin_AddSound("UserOnline", LPGENW("Alerts"), LPGENW("Online"));
  	return 0;
  }
 diff --git a/src/mir_app/src/button.cpp b/src/mir_app/src/button.cpp index ba0b4e8714..a39b55e5ce 100644 --- a/src/mir_app/src/button.cpp +++ b/src/mir_app/src/button.cpp @@ -37,7 +37,7 @@ struct TTooltips  static LIST<TTooltips> lToolTips(1, NumericKeySortT);
  static mir_cs csTips;
 -static BOOL bModuleInitialized = FALSE;
 +static bool bModuleInitialized = false;
  // Used for our own cheap TrackMouseEvent
  #define BUTTON_POLLID       100
 diff --git a/src/mir_app/src/chat_opts.cpp b/src/mir_app/src/chat_opts.cpp index 1b31dae8f5..98ea06b72c 100644 --- a/src/mir_app/src/chat_opts.cpp +++ b/src/mir_app/src/chat_opts.cpp @@ -323,17 +323,17 @@ int OptionsInit(void)  	g_Settings->iWidth = db_get_dw(0, CHAT_MODULE, "roomwidth", -1);
  	g_Settings->iHeight = db_get_dw(0, CHAT_MODULE, "roomheight", -1);
 -	SkinAddNewSoundEx("ChatMessage", LPGEN("Group chats"), LPGEN("Incoming message"));
 -	SkinAddNewSoundEx("ChatHighlight", LPGEN("Group chats"), LPGEN("Message is highlighted"));
 -	SkinAddNewSoundEx("ChatAction", LPGEN("Group chats"), LPGEN("User has performed an action"));
 -	SkinAddNewSoundEx("ChatJoin", LPGEN("Group chats"), LPGEN("User has joined"));
 -	SkinAddNewSoundEx("ChatPart", LPGEN("Group chats"), LPGEN("User has left"));
 -	SkinAddNewSoundEx("ChatKick", LPGEN("Group chats"), LPGEN("User has kicked some other user"));
 -	SkinAddNewSoundEx("ChatMode", LPGEN("Group chats"), LPGEN("User's status was changed"));
 -	SkinAddNewSoundEx("ChatNick", LPGEN("Group chats"), LPGEN("User has changed name"));
 -	SkinAddNewSoundEx("ChatNotice", LPGEN("Group chats"), LPGEN("User has sent a notice"));
 -	SkinAddNewSoundEx("ChatQuit", LPGEN("Group chats"), LPGEN("User has disconnected"));
 -	SkinAddNewSoundEx("ChatTopic", LPGEN("Group chats"), LPGEN("The topic has been changed"));
 +	Skin_AddSound("ChatMessage",   LPGENW("Group chats"), LPGENW("Incoming message"));
 +	Skin_AddSound("ChatHighlight", LPGENW("Group chats"), LPGENW("Message is highlighted"));
 +	Skin_AddSound("ChatAction",    LPGENW("Group chats"), LPGENW("User has performed an action"));
 +	Skin_AddSound("ChatJoin",      LPGENW("Group chats"), LPGENW("User has joined"));
 +	Skin_AddSound("ChatPart",      LPGENW("Group chats"), LPGENW("User has left"));
 +	Skin_AddSound("ChatKick",      LPGENW("Group chats"), LPGENW("User has kicked some other user"));
 +	Skin_AddSound("ChatMode",      LPGENW("Group chats"), LPGENW("User's status was changed"));
 +	Skin_AddSound("ChatNick",      LPGENW("Group chats"), LPGENW("User has changed name"));
 +	Skin_AddSound("ChatNotice",    LPGENW("Group chats"), LPGENW("User has sent a notice"));
 +	Skin_AddSound("ChatQuit",      LPGENW("Group chats"), LPGENW("User has disconnected"));
 +	Skin_AddSound("ChatTopic",     LPGENW("Group chats"), LPGENW("The topic has been changed"));
  	return 0;
  }
 diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp index 2b0ccdde6b..1bffbfb6a3 100644 --- a/src/mir_app/src/chat_tools.cpp +++ b/src/mir_app/src/chat_tools.cpp @@ -280,7 +280,7 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight  	if (bHighlight) {
  		gce->pDest->iType |= GC_EVENT_HIGHLIGHT;
  		if (bInactive || !g_Settings->bSoundsFocus)
 -			SkinPlaySound("ChatHighlight");
 +			Skin_PlaySound("ChatHighlight");
  		if (db_get_b(si->hContact, "CList", "Hidden", 0) != 0)
  			db_unset(si->hContact, "CList", "Hidden");
  		if (bInactive)
 @@ -306,28 +306,28 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight  		switch (iEvent) {
  		case GC_EVENT_JOIN:
  			if (bInactive || !g_Settings->bSoundsFocus)
 -				SkinPlaySound("ChatJoin");
 +				Skin_PlaySound("ChatJoin");
  			break;
  		case GC_EVENT_PART:
  			if (bInactive || !g_Settings->bSoundsFocus)
 -				SkinPlaySound("ChatPart");
 +				Skin_PlaySound("ChatPart");
  			break;
  		case GC_EVENT_QUIT:
  			if (bInactive || !g_Settings->bSoundsFocus)
 -				SkinPlaySound("ChatQuit");
 +				Skin_PlaySound("ChatQuit");
  			break;
  		case GC_EVENT_ADDSTATUS:
  		case GC_EVENT_REMOVESTATUS:
  			if (bInactive || !g_Settings->bSoundsFocus)
 -				SkinPlaySound("ChatMode");
 +				Skin_PlaySound("ChatMode");
  			break;
  		case GC_EVENT_KICK:
  			if (bInactive || !g_Settings->bSoundsFocus)
 -				SkinPlaySound("ChatKick");
 +				Skin_PlaySound("ChatKick");
  			break;
  		case GC_EVENT_MESSAGE:
  			if (bInactive || !g_Settings->bSoundsFocus)
 -				SkinPlaySound("ChatMessage");
 +				Skin_PlaySound("ChatMessage");
  			if (bInactive && !(si->wState & STATE_TALK)) {
  				si->wState |= STATE_TALK;
 @@ -338,19 +338,19 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight  			break;
  		case GC_EVENT_ACTION:
  			if (bInactive || !g_Settings->bSoundsFocus)
 -				SkinPlaySound("ChatAction");
 +				Skin_PlaySound("ChatAction");
  			break;
  		case GC_EVENT_NICK:
  			if (bInactive || !g_Settings->bSoundsFocus)
 -				SkinPlaySound("ChatNick");
 +				Skin_PlaySound("ChatNick");
  			break;
  		case GC_EVENT_NOTICE:
  			if (bInactive || !g_Settings->bSoundsFocus)
 -				SkinPlaySound("ChatNotice");
 +				Skin_PlaySound("ChatNotice");
  			break;
  		case GC_EVENT_TOPIC:
  			if (bInactive || !g_Settings->bSoundsFocus)
 -				SkinPlaySound("ChatTopic");
 +				Skin_PlaySound("ChatTopic");
  			break;
  		}
  	}
 diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index a0addf8ff5..f810bb6e0e 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -453,3 +453,6 @@ Hotkey_Unsubclass @457  Hotkey_Check @458
  ?SetStatusText@CSrmmBaseDialog@@UAEXPB_WPAUHICON__@@@Z @459 NONAME
  Srmm_SetStatusText @460
 +Skin_AddSound @461
 +Skin_PlaySound @462
 +Skin_PlaySoundFile @463
 diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 963f8cd9ad..ec9a39feb2 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -453,3 +453,6 @@ Hotkey_Unsubclass @457  Hotkey_Check @458
  ?SetStatusText@CSrmmBaseDialog@@UEAAXPEB_WPEAUHICON__@@@Z @459 NONAME
  Srmm_SetStatusText @460
 +Skin_AddSound @461
 +Skin_PlaySound @462
 +Skin_PlaySoundFile @463
 diff --git a/src/mir_app/src/sounds.cpp b/src/mir_app/src/sounds.cpp index 9775a42965..a6a964119f 100644 --- a/src/mir_app/src/sounds.cpp +++ b/src/mir_app/src/sounds.cpp @@ -53,7 +53,7 @@ static int CompareSounds(const SoundItem* p1, const SoundItem* p2)  static OBJLIST<SoundItem> arSounds(10, CompareSounds);
 -///////////////////////////////////////////////////////////////////////////////
 +/////////////////////////////////////////////////////////////////////////////////////////
  MIR_APP_DLL(void) KillModuleSounds(int _hLang)
  {
 @@ -66,66 +66,34 @@ MIR_APP_DLL(void) KillModuleSounds(int _hLang)  	}
  }
 -///////////////////////////////////////////////////////////////////////////////
 +/////////////////////////////////////////////////////////////////////////////////////////
 -HTREEITEM FindNamedTreeItemAtRoot(HWND hwndTree, const wchar_t* name)
 -{
 -	wchar_t str[128];
 -	TVITEM tvi;
 -	tvi.mask = TVIF_TEXT;
 -	tvi.pszText = str;
 -	tvi.cchTextMax = _countof(str);
 -	tvi.hItem = TreeView_GetRoot(hwndTree);
 -	while (tvi.hItem != nullptr) {
 -		SendMessage(hwndTree, TVM_GETITEM, 0, (LPARAM)&tvi);
 -		if (!mir_wstrcmpi(str, name))
 -			return tvi.hItem;
 -
 -		tvi.hItem = TreeView_GetNextSibling(hwndTree, tvi.hItem);
 -	}
 -	return nullptr;
 -}
 -
 -static BOOL bModuleInitialized = FALSE;
  static HANDLE hPlayEvent = nullptr;
 -static INT_PTR ServiceSkinAddNewSound(WPARAM wParam, LPARAM lParam)
 +MIR_APP_DLL(int) Skin_AddSound(const char *pszName, const wchar_t *pwszSection, const wchar_t *pwszDescription, const wchar_t *pwszDefaultFile, int _hLang)
  {
 -	SKINSOUNDDESCEX *ssd = (SKINSOUNDDESCEX*)lParam;
 -	if (ssd->cbSize != sizeof(SKINSOUNDDESCEX) || ssd->pszName == nullptr || ssd->pszDescription == nullptr)
 +	if (pszName == nullptr || pwszDescription == nullptr)
  		return 1;
  	SoundItem *item = new SoundItem; // due to OBJLIST
 -	item->name = mir_strdup(ssd->pszName);
 +	item->name = mir_strdup(pszName);
  	item->ptszTempFile = nullptr;
 -	item->hLangpack = (int)wParam;
 +	item->hLangpack = _hLang;
  	arSounds.insert(item);
 -	wchar_t *pwszDefaultFile;
 -	if (ssd->dwFlags & SSDF_UNICODE) {
 -		item->pwszDescription = mir_wstrdup(ssd->pwszDescription);
 -		item->pwszSection = mir_wstrdup((ssd->pszSection != nullptr) ? ssd->pwszSection : L"Other");
 -		pwszDefaultFile = mir_wstrdup(ssd->pwszDefaultFile);
 -	}
 -	else {
 -		item->pwszDescription = mir_a2u(ssd->pszDescription);
 -		item->pwszSection = mir_a2u((ssd->pszSection != nullptr) ? ssd->pszSection : "Other");
 -		pwszDefaultFile = mir_a2u(ssd->pszDefaultFile);
 -	}
 +	item->pwszDescription = mir_wstrdup(pwszDescription);
 +	item->pwszSection = mir_wstrdup((pwszSection != nullptr) ? pwszSection : L"Other");
  	if (pwszDefaultFile) {
 -		DBVARIANT dbv;
 -		if (db_get_s(0, "SkinSounds", item->name, &dbv))
 +		ptrW wszSavedValue(db_get_wsa(0, "SkinSounds", item->name));
 +		if (wszSavedValue == nullptr)
  			db_set_ws(0, "SkinSounds", item->name, pwszDefaultFile);
 -		else
 -			db_free(&dbv);
 -		mir_free(pwszDefaultFile);
  	}
  	return 0;
  }
 -static int SkinPlaySoundDefault(WPARAM wParam, LPARAM lParam)
 +static int Skin_PlaySoundDefault(WPARAM wParam, LPARAM lParam)
  {
  	wchar_t *pszFile = (wchar_t*) lParam;
  	if (pszFile && (db_get_b(0, "Skin", "UseSound", 0) || (int)wParam == 1))
 @@ -134,25 +102,23 @@ static int SkinPlaySoundDefault(WPARAM wParam, LPARAM lParam)  	return 0;
  }
 -static INT_PTR ServiceSkinPlaySoundFile(WPARAM, LPARAM lParam)
 +MIR_APP_DLL(int) Skin_PlaySoundFile(const wchar_t *pwszFileName)
  {
 -	wchar_t *ptszFileName = (wchar_t*)lParam;
 -	if (ptszFileName == nullptr)
 +	if (pwszFileName == nullptr)
  		return 1;
  	wchar_t tszFull[MAX_PATH];
 -	PathToAbsoluteW(ptszFileName, tszFull);
 +	PathToAbsoluteW(pwszFileName, tszFull);
  	NotifyEventHooks(hPlayEvent, 0, (LPARAM)tszFull);
  	return 0;
  }
 -static INT_PTR ServiceSkinPlaySound(WPARAM, LPARAM lParam)
 +MIR_APP_DLL(int) Skin_PlaySound(const char *pszSoundName)
  {
 -	char *pszSoundName = (char*)lParam;
  	if (pszSoundName == nullptr)
  		return 1;
 -	SoundItem tmp = { pszSoundName };
 +	SoundItem tmp = { (char*)pszSoundName };
  	int idx = arSounds.getIndex(&tmp);
  	if (idx == -1)
  		return 1;
 @@ -160,13 +126,12 @@ static INT_PTR ServiceSkinPlaySound(WPARAM, LPARAM lParam)  	if (db_get_b(0, "SkinSoundsOff", pszSoundName, 0))
  		return 1;
 -	DBVARIANT dbv;
 -	if (db_get_ws(0, "SkinSounds", pszSoundName, &dbv) == 0) {
 -		ServiceSkinPlaySoundFile(0, (LPARAM)dbv.ptszVal);
 -		db_free(&dbv);
 -		return 0;
 -	}
 -	return 1;
 +	ptrW wszFilePath(db_get_wsa(0, "SkinSounds", pszSoundName));
 +	if (wszFilePath == nullptr)
 +		return 1;
 +
 +	Skin_PlaySoundFile(wszFilePath);
 +	return 0;
  }
  #define DM_REBUILD_STREE (WM_USER+1)
 @@ -174,6 +139,24 @@ static INT_PTR ServiceSkinPlaySound(WPARAM, LPARAM lParam)  #define DM_SHOWPANE      (WM_USER+3)
  #define DM_CHECKENABLED  (WM_USER+4)
 +static HTREEITEM FindNamedTreeItemAtRoot(HWND hwndTree, const wchar_t* name)
 +{
 +	wchar_t str[128];
 +	TVITEM tvi;
 +	tvi.mask = TVIF_TEXT;
 +	tvi.pszText = str;
 +	tvi.cchTextMax = _countof(str);
 +	tvi.hItem = TreeView_GetRoot(hwndTree);
 +	while (tvi.hItem != nullptr) {
 +		SendMessage(hwndTree, TVM_GETITEM, 0, (LPARAM)&tvi);
 +		if (!mir_wstrcmpi(str, name))
 +			return tvi.hItem;
 +
 +		tvi.hItem = TreeView_GetNextSibling(hwndTree, tvi.hItem);
 +	}
 +	return nullptr;
 +}
 +
  INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
  {
  	static HWND hwndTree = nullptr;
 @@ -474,14 +457,9 @@ static int SkinSystemModulesLoaded(WPARAM, LPARAM)  int LoadSkinSounds(void)
  {
 -	bModuleInitialized = TRUE;
 -
 -	CreateServiceFunction("Skin/Sounds/AddNew", ServiceSkinAddNewSound);
 -	CreateServiceFunction(MS_SKIN_PLAYSOUND, ServiceSkinPlaySound);
 -	CreateServiceFunction(MS_SKIN_PLAYSOUNDFILE, ServiceSkinPlaySoundFile);
  	HookEvent(ME_SYSTEM_MODULESLOADED, SkinSystemModulesLoaded);
  	hPlayEvent = CreateHookableEvent(ME_SKIN_PLAYINGSOUND);
 -	SetHookDefaultForHookableEvent(hPlayEvent, SkinPlaySoundDefault);
 +	SetHookDefaultForHookableEvent(hPlayEvent, Skin_PlaySoundDefault);
  	return 0;
  }
 | 
