|
|
@@ -102,16 +102,8 @@ void CMessagePush::HandleMessage(std::string msg)
|
|
|
//新订单来了,首先判断是否要语音提醒
|
|
|
if (CSetting::GetParam("setting_is_new_waimai_voice") == "1")
|
|
|
{
|
|
|
- //需要语音提醒
|
|
|
- std::wstring filepath = L"music/new_wamai_order.mp3";
|
|
|
- std::wstring Open = L"OPEN " + filepath + L" ALIAS MUSIC";
|
|
|
- mciSendString(Open.c_str(), NULL, 0, 0);
|
|
|
-
|
|
|
- std::wstring Play = L"PLAY MUSIC FROM 0";
|
|
|
- mciSendString(Play.c_str(), NULL, 0, 0);
|
|
|
-
|
|
|
- std::wstring Close = L"CLOSE MUSIC";
|
|
|
- mciSendString(Close.c_str(), NULL, 0, 0);
|
|
|
+ wstring path = CSystem::GetProgramDir() + L"\\music\\new_wamai_order.wav";
|
|
|
+ PlaySound(path.c_str(), NULL, SND_FILENAME | SND_ASYNC);
|
|
|
}
|
|
|
|
|
|
//判断是否要自动确认
|
|
|
@@ -173,7 +165,7 @@ void CMessagePush::handle_read(const boost::system::error_code& error,
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- delete this;
|
|
|
+ //这里有时会出现,看看是什么错误,可能是断开了跟服务器的连接
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -185,6 +177,6 @@ void CMessagePush::handle_write(const boost::system::error_code& error)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- delete this;
|
|
|
+ //这里有时会出现,看看是什么错误,可能是断开了跟服务器的连接
|
|
|
}
|
|
|
}
|