summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2012-10-14 18:00:13 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2012-10-14 18:00:13 +0000
commitc234e05eaebd86d4c7e2696c48655d625fde3def (patch)
tree18025cfdd7ea5b52a014dc391153d31a0d59e8d8 /plugins
parent64d17bdf1ae8c9ff22487df2202b4cd46d88b418 (diff)
* use miranda API to play sounds
git-svn-id: http://svn.miranda-ng.org/main/trunk@1936 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/SeenPlugin/src/utils.cpp25
1 files changed, 9 insertions, 16 deletions
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