From 89c5b2369413025e1fe7dfe5c5d0bf3bedd8558d Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Mon, 23 Jul 2012 13:52:57 +0000 Subject: git-svn-id: http://svn.miranda-ng.org/main/trunk@1123 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/XSoundNotify/xsn_main.cpp | 122 -------------------------------------- 1 file changed, 122 deletions(-) delete mode 100644 plugins/XSoundNotify/xsn_main.cpp (limited to 'plugins/XSoundNotify/xsn_main.cpp') diff --git a/plugins/XSoundNotify/xsn_main.cpp b/plugins/XSoundNotify/xsn_main.cpp deleted file mode 100644 index ebcf029143..0000000000 --- a/plugins/XSoundNotify/xsn_main.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* -Miranda plugin template, originally by Richard Hughes -http://miranda-icq.sourceforge.net/ - -This file is placed in the public domain. Anybody is free to use or -modify it as they wish with no restriction. -There is no warranty. -*/ - -#include "SettingsDialog.h" - -#include -#include -#include -#include -#include -#include -#include -#include "xsn_utils.h" -//#include "DebugLogger.hpp" - -HINSTANCE hInst; -PLUGINLINK *pluginLink; -HANDLE AddEventHook; - -PLUGININFOEX pluginInfo = { - sizeof(PLUGININFOEX), // Размер стуктуры - "XSoundNotify", // Короткое имя плагинв - PLUGIN_MAKE_VERSION(1,0,0,0), // Версия плагина - "Provides extended options for sound notifications", // Описание плагина - "Roman Torsten", // Автор - "rs_torsten-public@yahoo.com", // Адресс автора - "© 2011 Copyright", // Копирайт - "https://plus.google.com/117081718640940130539", // Адресс сайта разработчика плагина - 0, - 0, - {0x8b86253, 0xec6e, 0x4d09, { 0xb7, 0xa9, 0x64, 0xac, 0xdf, 0x6, 0x27, 0xb8 }} //{08B86253-EC6E-4d09-B7A9-64ACDF0627B8} -}; - -extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) -{ - hInst = hinstDLL; - return TRUE; -} - -static int PluginMenuCommand(WPARAM wParam,LPARAM lParam) -{ - try - { - SoundNotifyDataStorage storage(pluginLink); - storage.init(); - SettingsDialog dlg(storage); - if (dlg.DoModal() == IDOK) - storage.commit(); - } - catch (...) - { - MessageBox(0, TEXT("Unknown error occured while configuring"), TEXT("XSoundNotify Error"), MB_OK | MB_ICONERROR); - } - - return 0; -} - -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) -{ - return &pluginInfo; -} - -extern "C" __declspec(dllexport) const MUUID interfaces[] = {MIID_TESTPLUGIN, MIID_LAST}; -extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) -{ - return interfaces; -} - -INT processEvent(WPARAM wParam, LPARAM lParam) -{ - try - { - if (!isReceiveMessage(lParam)) - return 0; - - xsn_string sound = getContactSound((HANDLE)wParam); - if (!sound.empty()) - PlaySound(sound.c_str(), nullptr, SND_ASYNC | SND_FILENAME); - } - catch (std::exception & ) - { - // log - } - catch (...) - { - // log - } - - return 0; -} - -extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) -{ - CLISTMENUITEM mi; - - pluginLink=link; - CreateServiceFunction("XSoundNotify/MenuCommand", PluginMenuCommand); - ZeroMemory(&mi,sizeof(mi)); - mi.cbSize=sizeof(mi); - mi.position=-0x7FFFFFFF; - mi.flags=0; - mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); - mi.pszName=LPGEN("&XSoundNotify Plugin"); - mi.pszService="XSoundNotify/MenuCommand"; - CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi); - AddEventHook = HookEvent(ME_DB_EVENT_ADDED, processEvent); - - return 0; -} - -extern "C" int __declspec(dllexport) Unload(void) -{ - UnhookEvent(AddEventHook); - return 0; -} - -- cgit v1.2.3