From c234e05eaebd86d4c7e2696c48655d625fde3def Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Sun, 14 Oct 2012 18:00:13 +0000 Subject: * use miranda API to play sounds git-svn-id: http://svn.miranda-ng.org/main/trunk@1936 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SeenPlugin/src/utils.cpp | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'plugins/SeenPlugin/src') diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index 2aa11670d9..5e2143eb8c 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -519,18 +519,13 @@ void ShowPopup(HANDLE hcontact, const char * lpzProto, int newStatus) void myPlaySound(HANDLE hcontact, WORD newStatus, WORD oldStatus){ if (CallService(MS_IGNORE_ISIGNORED,(WPARAM)hcontact,IGNOREEVENT_USERONLINE)) return; //oldStatus and hcontact are not used yet - if ( db_get_b(NULL,"Skin","UseSound",1)) { - char * soundname=0; - if ((newStatus==ID_STATUS_ONLINE) || (newStatus==ID_STATUS_FREECHAT)) soundname = "LastSeenTrackedStatusOnline"; - else if (newStatus==ID_STATUS_OFFLINE) soundname = "LastSeenTrackedStatusOffline"; - else if (oldStatus==ID_STATUS_OFFLINE) soundname = "LastSeenTrackedStatusFromOffline"; - else soundname = "LastSeenTrackedStatusChange"; - if (!db_get_b(NULL,"SkinSoundsOff",soundname,0)) { - DBVARIANT dbv; - if ( !DBGetContactSettingTString(NULL, "SkinSounds", soundname, &dbv)) { - PlaySound(dbv.ptszVal, NULL, SND_ASYNC | SND_FILENAME | SND_NOWAIT); - db_free(&dbv); -} } } } + char * soundname=0; + if ((newStatus==ID_STATUS_ONLINE) || (newStatus==ID_STATUS_FREECHAT)) soundname = "LastSeenTrackedStatusOnline"; + else if (newStatus==ID_STATUS_OFFLINE) soundname = "LastSeenTrackedStatusOffline"; + else if (oldStatus==ID_STATUS_OFFLINE) soundname = "LastSeenTrackedStatusFromOffline"; + else soundname = "LastSeenTrackedStatusChange"; + if (soundname!=0) SkinPlaySound(soundname); +} //will give hContact position or zero int isContactQueueActive(HANDLE hContact){ @@ -598,13 +593,11 @@ static DWORD __stdcall waitThread(logthread_info* infoParam) int UpdateValues(WPARAM wparam,LPARAM lparam) { - DBCONTACTWRITESETTING *cws; - BOOL isIdleEvent; // to make this code faster if (!wparam) return 0; - cws=(DBCONTACTWRITESETTING *)lparam; + DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING *)lparam; //if (CallService(MS_IGNORE_ISIGNORED,(WPARAM)hContact,IGNOREEVENT_USERONLINE)) return 0; - isIdleEvent = includeIdle?(strcmp(cws->szSetting,"IdleTS")==0):0; + BOOL isIdleEvent = includeIdle?(strcmp(cws->szSetting,"IdleTS")==0):0; if (strcmp(cws->szSetting,"Status") && strcmp(cws->szSetting,"StatusTriger") && (isIdleEvent==0)) return 0; if (!strcmp(cws->szModule,S_MOD)) { //here we will come when Settings/SeenModule/StatusTriger is changed -- cgit v1.2.3