summaryrefslogtreecommitdiff
path: root/plugins/!NotAdopted/WinterSpeak/speak
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/!NotAdopted/WinterSpeak/speak')
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/announce/announce_database.cpp111
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/announce/announce_database.h80
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/announce/dialog_announce.cpp209
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/announce/dialog_announce.h48
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/announce/event_information.cpp117
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/announce/event_information.h69
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/announce/protocol_information.cpp100
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/announce/protocol_information.h41
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/announce/speak_announce.cpp243
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/announce/speak_announce.h74
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/checked.icobin0 -> 318 bytes
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/config/config_database.cpp174
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/config/config_database.h91
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/config/dialog_config_active.cpp234
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/config/dialog_config_active.h56
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/config/dialog_config_engine.cpp289
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/config/dialog_config_engine.h59
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/config/speak_config.cpp170
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/config/speak_config.h59
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/config/speech_interface.cpp91
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/config/speech_interface.h48
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/defs/voice_desc.h26
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/dialog/miranda_dialog.cpp36
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/dialog/miranda_dialog.h59
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/m_speak.h18
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/resource.h57
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/speak.cpp238
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/speak.dsp275
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/speak.dsw79
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/speak.h27
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/speak.rc266
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/unchecked.icobin0 -> 318 bytes
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/user/user_information.cpp116
-rw-r--r--plugins/!NotAdopted/WinterSpeak/speak/user/user_information.h69
34 files changed, 3629 insertions, 0 deletions
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/announce/announce_database.cpp b/plugins/!NotAdopted/WinterSpeak/speak/announce/announce_database.cpp
new file mode 100644
index 0000000000..f5720624a7
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/announce/announce_database.cpp
@@ -0,0 +1,111 @@
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#pragma warning(disable:4786)
+
+#include "announce_database.h"
+
+#include <general/debug/debug.h>
+
+#include <windows.h>
+#include <miranda32/random/plugins/newpluginapi.h>
+#include <miranda32/database/m_database.h>
+
+//------------------------------------------------------------------------------
+namespace
+{
+ const char *SPEAK = "speak_announce";
+ const char *STATUS_FLAGS = "status_flags";
+ const char *EVENT_FLAGS = "event_flags";
+ const char *MAX_MSG_SIZE = "max_msg_size";
+}
+
+//------------------------------------------------------------------------------
+// public:
+//------------------------------------------------------------------------------
+AnnounceDatabase::AnnounceDatabase()
+ :
+ m_status_flags(0),
+ m_event_flags(0),
+ m_max_msg(0)
+{
+ CLASSCERR("AnnounceDatabase::AnnounceDatabase");
+
+ // load the database from miranda
+ load();
+}
+
+//------------------------------------------------------------------------------
+AnnounceDatabase::~AnnounceDatabase()
+{
+ CLASSCERR("AnnounceDatabase::~AnnounceDatabase");
+}
+
+//------------------------------------------------------------------------------
+bool
+AnnounceDatabase::getStatusFlag(StatusFlag flag) const
+{
+ return ((m_status_flags & (1 << flag)) != 0);
+}
+
+//------------------------------------------------------------------------------
+void
+AnnounceDatabase::setStatusFlag(StatusFlag flag, bool state)
+{
+ if (state)
+ {
+ m_status_flags |= (1 << flag);
+ }
+ else
+ {
+ m_status_flags &= ~(1 << flag);
+ }
+}
+
+//------------------------------------------------------------------------------
+bool
+AnnounceDatabase::getEventFlag(EventFlag flag) const
+{
+ return ((m_event_flags & (1 << flag)) != 0);
+}
+
+//------------------------------------------------------------------------------
+void
+AnnounceDatabase::setEventFlag(EventFlag flag, bool state)
+{
+ if (state)
+ {
+ m_event_flags |= (1 << flag);
+ }
+ else
+ {
+ m_event_flags &= ~(1 << flag);
+ }
+}
+
+//------------------------------------------------------------------------------
+void
+AnnounceDatabase::load()
+{
+ CLASSCERR("AnnounceDatabase::load");
+
+ m_status_flags = DBGetContactSettingDword(NULL, SPEAK, STATUS_FLAGS,
+ 0xffff);
+ m_event_flags = DBGetContactSettingDword(NULL, SPEAK, EVENT_FLAGS,
+ 0xffff);
+ m_max_msg = DBGetContactSettingDword(NULL, SPEAK, MAX_MSG_SIZE, 50);
+}
+
+//------------------------------------------------------------------------------
+void
+AnnounceDatabase::save()
+{
+ CLASSCERR("AnnounceDatabase::save");
+
+ DBWriteContactSettingDword(NULL, SPEAK, STATUS_FLAGS, m_status_flags);
+ DBWriteContactSettingDword(NULL, SPEAK, EVENT_FLAGS, m_event_flags);
+ DBWriteContactSettingDword(NULL, SPEAK, MAX_MSG_SIZE, m_max_msg);
+}
+
+//==============================================================================
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/announce/announce_database.h b/plugins/!NotAdopted/WinterSpeak/speak/announce/announce_database.h
new file mode 100644
index 0000000000..b3c950cd8d
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/announce/announce_database.h
@@ -0,0 +1,80 @@
+#ifndef guard_speak_announce_announce_database_h
+#define guard_speak_announce_announce_database_h
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#include <string>
+
+class AnnounceDatabase
+{
+ public:
+ AnnounceDatabase();
+ ~AnnounceDatabase();
+
+ enum StatusFlag
+ {
+ StatusFlag_Offline = 0,
+ StatusFlag_Online,
+ StatusFlag_Away,
+ StatusFlag_Dnd,
+ StatusFlag_Na,
+ StatusFlag_Occupied,
+ StatusFlag_FreeForChat,
+ StatusFlag_Invisible,
+ StatusFlag_SpeakStatusMsg,
+ StatusFlag_SuppressConnect,
+ };
+
+ enum EventFlag
+ {
+ EventFlag_Message = 0,
+ EventFlag_Url,
+ EventFlag_Added,
+ EventFlag_AuthRequest,
+ EventFlag_File,
+ EventFlag_ReadMsgLength,
+ EventFlag_DialogOpen,
+ EventFlag_DialogFocused,
+ };
+
+ //--------------------------------------------------------------------------
+ // Description : get/set a status flags
+ //--------------------------------------------------------------------------
+ bool getStatusFlag(StatusFlag flag) const;
+ void setStatusFlag(StatusFlag flag, bool state);
+
+ //--------------------------------------------------------------------------
+ // Description : get/set an event flags
+ //--------------------------------------------------------------------------
+ bool getEventFlag(EventFlag flag) const;
+ void setEventFlag(EventFlag flag, bool state);
+
+ //--------------------------------------------------------------------------
+ // Description : get/set an event flags
+ //--------------------------------------------------------------------------
+ unsigned int getMaxMsgSize() const { return m_max_msg; }
+ void setMaxMsgSize(unsigned int size) { m_max_msg = size; }
+
+ //--------------------------------------------------------------------------
+ // Description : load/save the settings from the miranda database
+ //--------------------------------------------------------------------------
+ void load();
+ void save();
+
+ private:
+ unsigned int m_status_flags;
+ unsigned int m_event_flags;
+
+ unsigned int m_max_msg;
+};
+
+//==============================================================================
+//
+// Summary : encapsulate the access to the miranda database
+//
+// Description : see summary
+//
+//==============================================================================
+
+#endif \ No newline at end of file
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/announce/dialog_announce.cpp b/plugins/!NotAdopted/WinterSpeak/speak/announce/dialog_announce.cpp
new file mode 100644
index 0000000000..5a21859ba5
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/announce/dialog_announce.cpp
@@ -0,0 +1,209 @@
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#pragma warning(disable:4786)
+
+#include "announce/dialog_announce.h"
+
+#include "resource.h"
+#include "speak.h"
+
+#include <general/debug/debug.h>
+
+#include <windows.h>
+
+//------------------------------------------------------------------------------
+AnnounceDialog *AnnounceDialog::m_instance = 0;
+
+//------------------------------------------------------------------------------
+// public:
+//------------------------------------------------------------------------------
+AnnounceDialog::AnnounceDialog(AnnounceDatabase &db)
+ :
+ m_db(db)
+{
+ CLASSCERR("AnnounceDialog::AnnounceDialog");
+
+ m_instance = this;
+}
+
+//------------------------------------------------------------------------------
+AnnounceDialog::~AnnounceDialog()
+{
+ CLASSCERR("AnnounceDialog::~AnnounceDialog");
+
+ m_instance = 0;
+}
+
+//------------------------------------------------------------------------------
+// private:
+//------------------------------------------------------------------------------
+int CALLBACK
+AnnounceDialog::process(HWND window, UINT message, WPARAM wparam, LPARAM lparam)
+{
+ if (!m_instance)
+ {
+ return 1;
+ }
+
+ switch (message)
+ {
+ case WM_INITDIALOG:
+ m_instance->load(window);
+ break;
+
+ case WM_COMMAND:
+ m_instance->command(window, wparam);
+ break;
+
+ case WM_NOTIFY:
+ if (PSN_APPLY == LPNMHDR(lparam)->code)
+ {
+ m_instance->save(window);
+ }
+ break;
+ }
+
+ return 0;
+}
+
+//------------------------------------------------------------------------------
+void
+AnnounceDialog::command(HWND window, int control)
+{
+ switch (LOWORD(control))
+ {
+ case IDC_STATUS_OFFLINE:
+ case IDC_STATUS_ONLINE:
+ case IDC_STATUS_AWAY:
+ case IDC_STATUS_DND:
+ case IDC_STATUS_NA:
+ case IDC_STATUS_OCCUPIED:
+ case IDC_STATUS_FREEFORCHAT:
+ case IDC_STATUS_INVISIBLE:
+ case IDC_SPEAK_STATUS_MSG:
+ case IDC_SUPPRESS_CONNECT:
+ case IDC_EVENT_MESSAGE:
+ case IDC_EVENT_URL:
+ case IDC_EVENT_FILE:
+ case IDC_EVENT_AUTHREQUEST:
+ case IDC_EVENT_ADDED:
+ case IDC_READ_MSG_LENGTH:
+ case IDC_DIALOG_OPEN:
+ case IDC_DIALOG_FOCUSED:
+
+ changed(window);
+ break;
+
+ case IDC_MAX_MSG:
+ if (EN_CHANGE == HIWORD(control))
+ {
+ changed(window);
+ }
+ break;
+ }
+}
+
+//------------------------------------------------------------------------------
+void
+AnnounceDialog::load(HWND window)
+{
+ CLASSCERR("AnnounceDialog::load");
+
+ TranslateDialogDefault(window);
+
+ // initialise the checkboxes
+ CheckDlgButton(window, IDC_STATUS_OFFLINE,
+ m_db.getStatusFlag(AnnounceDatabase::StatusFlag_Offline));
+ CheckDlgButton(window, IDC_STATUS_ONLINE,
+ m_db.getStatusFlag(AnnounceDatabase::StatusFlag_Online));
+ CheckDlgButton(window, IDC_STATUS_AWAY,
+ m_db.getStatusFlag(AnnounceDatabase::StatusFlag_Away));
+ CheckDlgButton(window, IDC_STATUS_DND,
+ m_db.getStatusFlag(AnnounceDatabase::StatusFlag_Dnd));
+ CheckDlgButton(window, IDC_STATUS_NA,
+ m_db.getStatusFlag(AnnounceDatabase::StatusFlag_Na));
+ CheckDlgButton(window, IDC_STATUS_OCCUPIED,
+ m_db.getStatusFlag(AnnounceDatabase::StatusFlag_Occupied));
+ CheckDlgButton(window, IDC_STATUS_FREEFORCHAT,
+ m_db.getStatusFlag(AnnounceDatabase::StatusFlag_FreeForChat));
+ CheckDlgButton(window, IDC_STATUS_INVISIBLE,
+ m_db.getStatusFlag(AnnounceDatabase::StatusFlag_Invisible));
+ CheckDlgButton(window, IDC_SPEAK_STATUS_MSG,
+ m_db.getStatusFlag(AnnounceDatabase::StatusFlag_SpeakStatusMsg));
+ CheckDlgButton(window, IDC_SUPPRESS_CONNECT,
+ m_db.getStatusFlag(AnnounceDatabase::StatusFlag_SuppressConnect));
+
+ CheckDlgButton(window, IDC_EVENT_MESSAGE,
+ m_db.getEventFlag(AnnounceDatabase::EventFlag_Message));
+ CheckDlgButton(window, IDC_EVENT_URL,
+ m_db.getEventFlag(AnnounceDatabase::EventFlag_Url));
+ CheckDlgButton(window, IDC_EVENT_FILE,
+ m_db.getEventFlag(AnnounceDatabase::EventFlag_File));
+ CheckDlgButton(window, IDC_EVENT_AUTHREQUEST,
+ m_db.getEventFlag(AnnounceDatabase::EventFlag_AuthRequest));
+ CheckDlgButton(window, IDC_EVENT_ADDED,
+ m_db.getEventFlag(AnnounceDatabase::EventFlag_Added));
+ CheckDlgButton(window, IDC_READ_MSG_LENGTH,
+ m_db.getEventFlag(AnnounceDatabase::EventFlag_ReadMsgLength));
+ CheckDlgButton(window, IDC_DIALOG_OPEN,
+ m_db.getEventFlag(AnnounceDatabase::EventFlag_DialogOpen));
+ CheckDlgButton(window, IDC_DIALOG_FOCUSED,
+ m_db.getEventFlag(AnnounceDatabase::EventFlag_DialogFocused));
+
+ // initialise the welcome message box
+ SetDlgItemInt(window, IDC_MAX_MSG, m_db.getMaxMsgSize(), 0);
+}
+
+//------------------------------------------------------------------------------
+void
+AnnounceDialog::save(HWND window)
+{
+ CLASSCERR("AnnounceDialog::save");
+
+ // store the checkboxes
+ m_db.setStatusFlag(AnnounceDatabase::StatusFlag_Offline,
+ (IsDlgButtonChecked(window, IDC_STATUS_OFFLINE) != 0));
+ m_db.setStatusFlag(AnnounceDatabase::StatusFlag_Online,
+ (IsDlgButtonChecked(window, IDC_STATUS_ONLINE) != 0));
+ m_db.setStatusFlag(AnnounceDatabase::StatusFlag_Away,
+ (IsDlgButtonChecked(window, IDC_STATUS_AWAY) != 0));
+ m_db.setStatusFlag(AnnounceDatabase::StatusFlag_Dnd,
+ (IsDlgButtonChecked(window, IDC_STATUS_DND) != 0));
+ m_db.setStatusFlag(AnnounceDatabase::StatusFlag_Na,
+ (IsDlgButtonChecked(window, IDC_STATUS_NA) != 0));
+ m_db.setStatusFlag(AnnounceDatabase::StatusFlag_Occupied,
+ (IsDlgButtonChecked(window, IDC_STATUS_OCCUPIED) != 0));
+ m_db.setStatusFlag(AnnounceDatabase::StatusFlag_FreeForChat,
+ (IsDlgButtonChecked(window, IDC_STATUS_FREEFORCHAT) != 0));
+ m_db.setStatusFlag(AnnounceDatabase::StatusFlag_Invisible,
+ (IsDlgButtonChecked(window, IDC_STATUS_INVISIBLE) != 0));
+ m_db.setStatusFlag(AnnounceDatabase::StatusFlag_SpeakStatusMsg,
+ (IsDlgButtonChecked(window, IDC_SPEAK_STATUS_MSG) != 0));
+ m_db.setStatusFlag(AnnounceDatabase::StatusFlag_SuppressConnect,
+ (IsDlgButtonChecked(window, IDC_SUPPRESS_CONNECT) != 0));
+
+ m_db.setEventFlag(AnnounceDatabase::EventFlag_Message,
+ (IsDlgButtonChecked(window, IDC_EVENT_MESSAGE) != 0));
+ m_db.setEventFlag(AnnounceDatabase::EventFlag_Url,
+ (IsDlgButtonChecked(window, IDC_EVENT_URL) != 0));
+ m_db.setEventFlag(AnnounceDatabase::EventFlag_File,
+ (IsDlgButtonChecked(window, IDC_EVENT_FILE) != 0));
+ m_db.setEventFlag(AnnounceDatabase::EventFlag_AuthRequest,
+ (IsDlgButtonChecked(window, IDC_EVENT_AUTHREQUEST) != 0));
+ m_db.setEventFlag(AnnounceDatabase::EventFlag_Added,
+ (IsDlgButtonChecked(window, IDC_EVENT_ADDED) != 0));
+ m_db.setEventFlag(AnnounceDatabase::EventFlag_ReadMsgLength,
+ (IsDlgButtonChecked(window, IDC_READ_MSG_LENGTH) != 0));
+ m_db.setEventFlag(AnnounceDatabase::EventFlag_DialogOpen,
+ (IsDlgButtonChecked(window, IDC_DIALOG_OPEN) != 0));
+ m_db.setEventFlag(AnnounceDatabase::EventFlag_DialogFocused,
+ (IsDlgButtonChecked(window, IDC_DIALOG_FOCUSED) != 0));
+
+ m_db.setMaxMsgSize(GetDlgItemInt(window, IDC_MAX_MSG, NULL, 0));
+
+ m_instance->m_db.save();
+}
+
+//============================================================================== \ No newline at end of file
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/announce/dialog_announce.h b/plugins/!NotAdopted/WinterSpeak/speak/announce/dialog_announce.h
new file mode 100644
index 0000000000..ea8fca5407
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/announce/dialog_announce.h
@@ -0,0 +1,48 @@
+#ifndef guard_speak_announce_announce_dialog_h
+#define guard_speak_announce_announce_dialog_h
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#include "dialog/miranda_dialog.h"
+#include "announce/announce_database.h"
+
+#include <wtypes.h>
+#include <string>
+
+class AnnounceDialog : public MirandaDialog
+{
+ public:
+ AnnounceDialog(AnnounceDatabase &db);
+ ~AnnounceDialog();
+
+ //--------------------------------------------------------------------------
+ // Description : process a dialog message
+ // Return : true - update the systems configuration
+ // false - do nothing
+ //--------------------------------------------------------------------------
+ static int CALLBACK process(HWND window, UINT message, WPARAM wparam,
+ LPARAM lparam);
+
+ private:
+ void command(HWND window, int control);
+
+ //--------------------------------------------------------------------------
+ // Description : load/save settings to the miranda database
+ //--------------------------------------------------------------------------
+ void load(HWND window);
+ void save(HWND window);
+
+ static AnnounceDialog *m_instance;
+ AnnounceDatabase &m_db;
+};
+
+//==============================================================================
+//
+// Summary : Configuration Dialog box
+//
+// Description : Set up the configuration dialog box and process its input
+//
+//==============================================================================
+
+#endif \ No newline at end of file
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/announce/event_information.cpp b/plugins/!NotAdopted/WinterSpeak/speak/announce/event_information.cpp
new file mode 100644
index 0000000000..bf326e5cfb
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/announce/event_information.cpp
@@ -0,0 +1,117 @@
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#pragma warning(disable:4786)
+
+#include "event_information.h"
+#include "speak.h"
+
+#include <general/debug/debug.h>
+
+//------------------------------------------------------------------------------
+// public:
+//------------------------------------------------------------------------------
+EventInformation::EventInformation()
+ :
+ m_event_strings(),
+ m_event_info()
+{
+ CLASSCERR("EventInformation::EventInformation");
+
+ // insert the event strings into a map for easy access
+ m_event_strings[EVENTTYPE_MESSAGE]
+ = Translate("incoming message from %u");
+ m_event_strings[EVENTTYPE_URL]
+ = Translate("incoming U R L from %u");
+ m_event_strings[EVENTTYPE_ADDED]
+ = Translate("you have been added to %u's contact list");
+ m_event_strings[EVENTTYPE_AUTHREQUEST]
+ = Translate("%u requests your authorization");
+ m_event_strings[EVENTTYPE_FILE]
+ = Translate("there is an incoming file from %u");
+
+ ZeroMemory(&m_event_info, sizeof(m_event_info));
+}
+
+//------------------------------------------------------------------------------
+EventInformation::~EventInformation()
+{
+ CLASSCERR("EventInformation::~EventInformation");
+}
+
+//------------------------------------------------------------------------------
+bool
+EventInformation::isValidEvent(HANDLE event)
+{
+ CLASSCERR("EventInformation::isValidEvent()");
+
+ // clean up the old event
+ if (m_event_info.pBlob)
+ {
+ delete m_event_info.pBlob;
+ }
+ ZeroMemory(&m_event_info, sizeof(m_event_info));
+
+ // find out and assign the space we need for the new event
+ m_event_info.cbSize = sizeof(m_event_info);
+ m_event_info.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE,
+ reinterpret_cast<LPARAM>(event), 0);
+
+ if (-1 == m_event_info.cbBlob)
+ {
+ return false;
+ }
+
+ m_event_info.pBlob = new unsigned char[m_event_info.cbBlob];
+
+ // get the event info
+ CallService(MS_DB_EVENT_GET, reinterpret_cast<LPARAM>(event),
+ reinterpret_cast<LPARAM>(&m_event_info));
+
+ // if the event has already been read or was sent by me then exit
+ if (m_event_info.flags & (DBEF_SENT | DBEF_READ))
+ {
+ return false;
+ }
+
+ // if the event string doesn't exist in our list then exit
+ if (m_event_strings.find(m_event_info.eventType) == m_event_strings.end())
+ {
+ return false;
+ }
+
+ // event was good
+ return true;
+}
+
+//------------------------------------------------------------------------------
+std::string
+EventInformation::getMessage()
+{
+ CLASSCERR("EventInformation::getMessage");
+
+ const std::string intro = Translate("%u says");
+
+ return intro + " " + (char *)m_event_info.pBlob;
+}
+
+//------------------------------------------------------------------------------
+unsigned int
+EventInformation::getMessageSize()
+{
+ CLASSCERR("EventInformation::getMessageSize");
+
+ return std::string((char *)m_event_info.pBlob).size();
+}
+
+//------------------------------------------------------------------------------
+std::string
+EventInformation::eventString()
+{
+ CLASSCERR("EventInformation::eventString");
+
+ return m_event_strings[m_event_info.eventType];
+}
+
+//==============================================================================
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/announce/event_information.h b/plugins/!NotAdopted/WinterSpeak/speak/announce/event_information.h
new file mode 100644
index 0000000000..626515e8ea
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/announce/event_information.h
@@ -0,0 +1,69 @@
+#ifndef guard_speak_announce_event_information_h
+#define guard_speak_announce_event_information_h
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#include <speak.h>
+
+#include <map>
+#include <string>
+
+class EventInformation
+{
+ public:
+ EventInformation();
+ ~EventInformation();
+
+ //--------------------------------------------------------------------------
+ // Description : is the event valid?
+ // Return : true = the event is valid
+ //--------------------------------------------------------------------------
+ bool isValidEvent(HANDLE event);
+
+ //--------------------------------------------------------------------------
+ // Description : get the last event received
+ // Return : the last event or 0 if none yet received
+ //--------------------------------------------------------------------------
+ unsigned short getLastEvent() { return m_event_info.eventType; }
+
+ //--------------------------------------------------------------------------
+ // Description : was the last event a messsage event?
+ // Return : true - yes it was
+ // false - no it wasn't
+ //--------------------------------------------------------------------------
+// bool isMessageEvent()
+// { return (m_event_info.eventType == EVENTTYPE_MESSAGE); }
+
+ //--------------------------------------------------------------------------
+ // Description : get the message from the last event
+ // Return : the last message
+ //--------------------------------------------------------------------------
+ std::string getMessage();
+
+ //--------------------------------------------------------------------------
+ // Description : get the size of the message from the last event
+ // Return : the size of the message
+ //--------------------------------------------------------------------------
+ unsigned int getMessageSize();
+
+ //--------------------------------------------------------------------------
+ // Description : get the event string
+ //--------------------------------------------------------------------------
+ std::string eventString();
+
+ private:
+ std::map<unsigned short, std::string> m_event_strings;
+
+ DBEVENTINFO m_event_info;
+};
+
+//==============================================================================
+//
+// Summary : API encapsulation
+//
+// Description : This encapsulates the SAPI 5.1 interface
+//
+//==============================================================================
+
+#endif \ No newline at end of file
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/announce/protocol_information.cpp b/plugins/!NotAdopted/WinterSpeak/speak/announce/protocol_information.cpp
new file mode 100644
index 0000000000..b3d9752bd4
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/announce/protocol_information.cpp
@@ -0,0 +1,100 @@
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#pragma warning(disable:4786)
+
+#include "protocol_information.h"
+
+#include <general/debug/debug.h>
+
+//------------------------------------------------------------------------------
+ProtocolInformation *ProtocolInformation::m_instance = 0;
+
+//------------------------------------------------------------------------------
+// public:
+//------------------------------------------------------------------------------
+ProtocolInformation::ProtocolInformation()
+ :
+ m_protocol_timeout()
+{
+ CLASSCERR("ProtocolInformation::ProtocolInformation");
+
+ m_instance = this;
+}
+
+//------------------------------------------------------------------------------
+ProtocolInformation::~ProtocolInformation()
+{
+ CLASSCERR("ProtocolInformation::~ProtocolInformation");
+
+ m_instance = 0;
+
+ // kill all the timers
+ for (ProtocolTimeoutQueue::const_iterator iter = m_protocol_timeout.begin();
+ iter != m_protocol_timeout.end();
+ ++iter)
+ {
+ KillTimer(NULL, (*iter).second);
+ }
+}
+
+//------------------------------------------------------------------------------
+void
+ProtocolInformation::disable(const char *protocol)
+{
+ CLASSCERR("ProtocolInformation::disable(" << protocol << ")");
+
+ if (NULL == protocol)
+ {
+ return;
+ }
+
+ const unsigned int TIMEOUT = 10000;
+
+ unsigned int t
+ = SetTimer(NULL, NULL, TIMEOUT, ProtocolInformation::timeout);
+ m_protocol_timeout.push_back(std::make_pair(protocol, t));
+}
+
+//------------------------------------------------------------------------------
+bool
+ProtocolInformation::isDisabled(const char *protocol) const
+{
+ CLASSCERR("ProtocolInformation::isDisable(" << protocol << ")");
+
+ if (NULL == protocol)
+ {
+ return false;
+ }
+
+ // iterate through the list and see if the protocol has a timer callback
+ for (ProtocolTimeoutQueue::const_iterator iter = m_protocol_timeout.begin();
+ iter != m_protocol_timeout.end();
+ ++iter)
+ {
+ if (0 == (*iter).first.compare(protocol))
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+//------------------------------------------------------------------------------
+// private:
+//------------------------------------------------------------------------------
+void CALLBACK
+ProtocolInformation::timeout(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime)
+{
+ CERR("ProtocolInformation::timeout(,,,)");
+
+ ProtocolTimeout pt = m_instance->m_protocol_timeout.front();
+
+ KillTimer(NULL, pt.second);
+
+ m_instance->m_protocol_timeout.pop_front();
+}
+
+//==============================================================================
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/announce/protocol_information.h b/plugins/!NotAdopted/WinterSpeak/speak/announce/protocol_information.h
new file mode 100644
index 0000000000..c003f43034
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/announce/protocol_information.h
@@ -0,0 +1,41 @@
+#ifndef guard_speak_announce_protocol_information_h
+#define guard_speak_announce_protocol_information_h
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#include <windows.h>
+
+#include <deque>
+#include <utility>
+
+class ProtocolInformation
+{
+ public:
+ ProtocolInformation();
+ ~ProtocolInformation();
+
+ void disable(const char *protocol);
+ bool isDisabled(const char *protocol) const;
+
+ private:
+ typedef std::pair<std::string, unsigned int> ProtocolTimeout;
+ typedef std::deque<ProtocolTimeout> ProtocolTimeoutQueue;
+
+ static void CALLBACK timeout(HWND hwnd, UINT uMsg, UINT idEvent,
+ DWORD dwTime);
+
+ static ProtocolInformation *m_instance;
+
+ ProtocolTimeoutQueue m_protocol_timeout;
+};
+
+//==============================================================================
+//
+// Summary :
+//
+// Description :
+//
+//==============================================================================
+
+#endif \ No newline at end of file
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/announce/speak_announce.cpp b/plugins/!NotAdopted/WinterSpeak/speak/announce/speak_announce.cpp
new file mode 100644
index 0000000000..d54d8354ed
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/announce/speak_announce.cpp
@@ -0,0 +1,243 @@
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#pragma warning(disable:4786)
+
+#include "speak_announce.h"
+
+#include "m_speak.h"
+
+#include <general/debug/debug.h>
+
+//------------------------------------------------------------------------------
+// public:
+//------------------------------------------------------------------------------
+SpeakAnnounce::SpeakAnnounce(HINSTANCE instance)
+ :
+ m_instance(instance),
+ m_db(),
+ m_dialog(m_db),
+ m_user_info(),
+ m_event_info(),
+ m_protocol_info()
+{
+ CLASSCERR("SpeakAnnounce::SpeakAnnounce");
+}
+
+//------------------------------------------------------------------------------
+SpeakAnnounce::~SpeakAnnounce()
+{
+ CLASSCERR("SpeakAnnounce::~SpeakAnnounce");
+}
+
+//------------------------------------------------------------------------------
+void
+SpeakAnnounce::statusChange(DBCONTACTWRITESETTING *write_setting, HANDLE user)
+{
+ const std::string STATUS = "Status";
+
+ // if the user is myself (NULL) then return
+ // if it's not a status change then return
+ // check and update the user's status, if status didn't change the return
+ if ((NULL == user)
+ || (STATUS != write_setting->szSetting)
+ || (!m_user_info.updateStatus(user, write_setting->value.wVal)))
+ {
+ return;
+ }
+
+ // check if we just connected, and want to suppress status changes
+ if (!m_db.getStatusFlag(AnnounceDatabase::StatusFlag_SuppressConnect)
+ && m_protocol_info.isDisabled(
+ (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)user, 0)))
+ {
+ return;
+ }
+
+ bool speak = false;
+
+ switch (write_setting->value.wVal)
+ {
+ case ID_STATUS_OFFLINE:
+ speak = m_db.getStatusFlag(AnnounceDatabase::StatusFlag_Offline);
+ break;
+ case ID_STATUS_ONLINE:
+ speak = m_db.getStatusFlag(AnnounceDatabase::StatusFlag_Online);
+ break;
+ case ID_STATUS_AWAY:
+ speak = m_db.getStatusFlag(AnnounceDatabase::StatusFlag_Away);
+ break;
+ case ID_STATUS_DND:
+ speak = m_db.getStatusFlag(AnnounceDatabase::StatusFlag_Dnd);
+ break;
+ case ID_STATUS_NA:
+ speak = m_db.getStatusFlag(AnnounceDatabase::StatusFlag_Na);
+ break;
+ case ID_STATUS_OCCUPIED:
+ speak = m_db.getStatusFlag(AnnounceDatabase::StatusFlag_Occupied);
+ break;
+ case ID_STATUS_FREECHAT:
+ speak = m_db.getStatusFlag(AnnounceDatabase::StatusFlag_FreeForChat);
+ break;
+ case ID_STATUS_INVISIBLE:
+ speak = m_db.getStatusFlag(AnnounceDatabase::StatusFlag_Invisible);
+ break;
+ }
+
+ if (!speak)
+ {
+ return;
+ }
+
+ // translate, insert name then speak
+ std::string status_str = Translate(m_user_info.statusString(user).c_str());
+ m_user_info.insertName(status_str, user);
+ say(status_str, user);
+}
+
+//------------------------------------------------------------------------------
+void
+SpeakAnnounce::incomingEvent(HANDLE user, HANDLE event)
+{
+ CLASSCERR("SpeakAnnounce::incomingEvent(" << user << "," << event << ")");
+
+ if (m_event_info.isValidEvent(event))
+ {
+ bool speak = false;
+
+ switch (m_event_info.getLastEvent())
+ {
+ case EVENTTYPE_MESSAGE:
+ speak = m_db.getEventFlag(AnnounceDatabase::EventFlag_Message);
+ break;
+
+ case EVENTTYPE_URL:
+ speak = m_db.getEventFlag(AnnounceDatabase::EventFlag_Url);
+ break;
+
+ case EVENTTYPE_ADDED:
+ speak = m_db.getEventFlag(AnnounceDatabase::EventFlag_Added);
+ break;
+
+ case EVENTTYPE_AUTHREQUEST:
+ speak = m_db.getEventFlag(AnnounceDatabase::EventFlag_AuthRequest);
+ break;
+
+ case EVENTTYPE_FILE:
+ speak = m_db.getEventFlag(AnnounceDatabase::EventFlag_File);
+ break;
+
+ }
+
+ if (!speak)
+ {
+ return;
+ }
+
+ std::string event_str = "";
+
+ if (EVENTTYPE_MESSAGE == m_event_info.getLastEvent())
+ {
+ if (!readMessage(user))
+ {
+ // message dialog is open so just leave without saying anything
+ return;
+ }
+
+ if ((m_db.getEventFlag(AnnounceDatabase::EventFlag_ReadMsgLength))
+ && (m_event_info.getMessageSize() <= m_db.getMaxMsgSize()))
+ {
+ // conditions met to read the message
+ event_str = m_event_info.getMessage();
+ }
+ else
+ {
+ event_str = m_event_info.eventString();
+ }
+ }
+ else
+ {
+ event_str = m_event_info.eventString();
+ }
+
+ // translate the string, insert the name, then speak it
+ m_user_info.insertName(event_str, user);
+ say(event_str, user);
+ }
+}
+
+//------------------------------------------------------------------------------
+void
+SpeakAnnounce::protocolAck(ACKDATA *ack)
+{
+ if (ACKTYPE_STATUS != ack->type)
+ {
+ return;
+ }
+
+ if (ID_STATUS_CONNECTING != (int)ack->hProcess)
+ {
+ return;
+ }
+
+ m_protocol_info.disable((char *)ack->szModule);
+}
+
+//------------------------------------------------------------------------------
+void
+SpeakAnnounce::say(const std::string &sentence, HANDLE user)
+{
+ CLASSCERR("SpeakAnnounce::say(" << sentence << ", " << (int)user << ")");
+
+ CallService(ME_SPEAK_SAY, reinterpret_cast<LPARAM>(user),
+ reinterpret_cast<WPARAM>(sentence.c_str()));
+}
+
+//------------------------------------------------------------------------------
+bool
+SpeakAnnounce::readMessage(HANDLE contact)
+{
+ std::string title = m_user_info.nameString(contact) + " ("
+ + m_user_info.statusModeString(contact) + "): ";
+
+ HWND window = NULL;
+
+ window = FindWindow("#32770", (title + Translate("Message Session")).c_str());
+ if (window)
+ {
+ // check if we dont want to read message if dialog is open
+ if (m_db.getEventFlag(AnnounceDatabase::EventFlag_DialogOpen))
+ {
+ return false;
+ }
+
+ // check if we dont want to read message if dialog if focused
+ if ((window == GetForegroundWindow())
+ && m_db.getEventFlag(AnnounceDatabase::EventFlag_DialogFocused))
+ {
+ return false;
+ }
+ }
+
+ window = FindWindow("#32770", (title + Translate("Message Received")).c_str());
+ if (window)
+ {
+ // check if we dont want to read message if dialog is open
+ if (m_db.getEventFlag(AnnounceDatabase::EventFlag_DialogOpen))
+ {
+ return false;
+ }
+
+ // check if we dont want to read message if dialog if focused
+ if ((window == GetForegroundWindow())
+ && m_db.getEventFlag(AnnounceDatabase::EventFlag_DialogFocused))
+ {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+//==============================================================================
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/announce/speak_announce.h b/plugins/!NotAdopted/WinterSpeak/speak/announce/speak_announce.h
new file mode 100644
index 0000000000..bd20ed6689
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/announce/speak_announce.h
@@ -0,0 +1,74 @@
+#ifndef guard_speak_announce_speak_announce_h
+#define guard_speak_announce_speak_announce_h
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#include "speak.h"
+#include "user/user_information.h"
+#include "announce/event_information.h"
+#include "announce/protocol_information.h"
+#include "announce/announce_database.h"
+#include "announce/dialog_announce.h"
+
+#include <wtypes.h>
+#include <string>
+#include <memory>
+
+class SpeakAnnounce
+{
+ public:
+ SpeakAnnounce(HINSTANCE instance);
+ ~SpeakAnnounce();
+
+ //--------------------------------------------------------------------------
+ // Description : handle a status change
+ //--------------------------------------------------------------------------
+ void statusChange(DBCONTACTWRITESETTING *write_setting, HANDLE user);
+
+ //--------------------------------------------------------------------------
+ // Description : handle an event
+ //--------------------------------------------------------------------------
+ void incomingEvent(HANDLE user, HANDLE event);
+
+ //--------------------------------------------------------------------------
+ // Description : handle a protocol state change
+ //--------------------------------------------------------------------------
+ void protocolAck(ACKDATA *ack);
+
+ //--------------------------------------------------------------------------
+ // Description : speak a sentence
+ // Parameters : sentence - the sentence to speak
+ // user - the user who is speaking, or NULL for no user
+ // Returns : true - speak successful
+ // false - speak failed
+ //--------------------------------------------------------------------------
+ void say(const std::string &sentence, HANDLE user);
+
+ private:
+ //--------------------------------------------------------------------------
+ // Description : check if the users message window is open and focused
+ // Parameters : contact - the user to check for
+ // Returns : true = message window is open
+ // false = message window not open
+ //--------------------------------------------------------------------------
+ bool readMessage(HANDLE contact);
+
+ HINSTANCE m_instance;
+
+ AnnounceDatabase m_db;
+ AnnounceDialog m_dialog;
+ UserInformation m_user_info;
+ EventInformation m_event_info;
+ ProtocolInformation m_protocol_info;
+};
+
+//==============================================================================
+//
+// Summary : The main object for the speak plugins
+//
+// Description : see summary
+//
+//==============================================================================
+
+#endif \ No newline at end of file
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/checked.ico b/plugins/!NotAdopted/WinterSpeak/speak/checked.ico
new file mode 100644
index 0000000000..e3e0d9513e
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/checked.ico
Binary files differ
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/config/config_database.cpp b/plugins/!NotAdopted/WinterSpeak/speak/config/config_database.cpp
new file mode 100644
index 0000000000..d634e44824
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/config/config_database.cpp
@@ -0,0 +1,174 @@
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#pragma warning(disable:4786)
+
+#include "config_database.h"
+
+#include "speak.h"
+
+#include <general/debug/debug.h>
+
+//------------------------------------------------------------------------------
+namespace
+{
+ const char *SPEAK = "speak_config";
+ const char *ACTIVE_FLAGS = "active_flags";
+ const char *ACTIVE_STATE = "active_state";
+ const char *WELCOME_MSG = "welcome_msg";
+ const char *ENGINE = "engine";
+ const char *VOICE = "voice";
+ const char *VOLUME = "volume";
+ const char *RATE = "rate";
+ const char *PITCH = "pitch";
+}
+
+//------------------------------------------------------------------------------
+// public:
+//------------------------------------------------------------------------------
+ConfigDatabase::ConfigDatabase()
+ :
+ m_voice_desc(),
+ m_active_flags(0),
+ m_welcome_msg(""),
+ m_active_users()
+{
+ CLASSCERR("ConfigDatabase::ConfigDatabase");
+
+ // load the database from miranda
+ load();
+}
+
+//------------------------------------------------------------------------------
+ConfigDatabase::~ConfigDatabase()
+{
+ CLASSCERR("ConfigDatabase::~ConfigDatabase");
+}
+
+//------------------------------------------------------------------------------
+bool
+ConfigDatabase::getActiveFlag(ActiveFlag flag) const
+{
+ return ((m_active_flags & (1 << flag)) != 0);
+}
+
+//------------------------------------------------------------------------------
+void
+ConfigDatabase::setActiveFlag(ActiveFlag flag, bool state)
+{
+ if (state)
+ {
+ m_active_flags |= (1 << flag);
+ }
+ else
+ {
+ m_active_flags &= ~(1 << flag);
+ }
+}
+
+//------------------------------------------------------------------------------
+bool
+ConfigDatabase::getActiveUser(HANDLE user) const
+{
+ ActiveUsersMap::const_iterator iter = m_active_users.find(user);
+
+ if (iter == m_active_users.end())
+ {
+ // get the unknown user status
+ iter = m_active_users.find(0);
+
+ if (iter == m_active_users.end())
+ {
+ CLASSCERR("ConfigDatabase::getActiveUser user error");
+ return false;
+ }
+ }
+
+ return iter->second;
+}
+
+//------------------------------------------------------------------------------
+void
+ConfigDatabase::setActiveUser(HANDLE user, bool state)
+{
+ m_active_users[user] = state;
+}
+
+//------------------------------------------------------------------------------
+void
+ConfigDatabase::load()
+{
+ CLASSCERR("ConfigDatabase::load");
+
+ m_voice_desc.engine = DBGetContactSettingString(SPEAK, ENGINE, "");
+ m_voice_desc.voice = DBGetContactSettingString(SPEAK, VOICE, "");
+ m_voice_desc.volume = DBGetContactSettingDword(NULL, SPEAK, VOLUME, 50);
+ m_voice_desc.pitch = DBGetContactSettingDword(NULL, SPEAK, PITCH, 50);
+ m_voice_desc.rate = DBGetContactSettingDword(NULL, SPEAK, RATE, 50);
+
+ m_active_flags = DBGetContactSettingDword(NULL, SPEAK, ACTIVE_FLAGS, 0xffff);
+
+ m_welcome_msg = DBGetContactSettingString(SPEAK, WELCOME_MSG,
+ "welcome to i c q");
+
+ // iterate through all the users and add them to the list if active
+ HANDLE contact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+
+ while (NULL != contact)
+ {
+ m_active_users[contact]
+ = DBGetContactSettingByte(contact, SPEAK, ACTIVE_STATE, true);
+
+ contact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)contact, 0);
+ }
+
+ // load unknown users setting
+ m_active_users[0] = DBGetContactSettingByte(NULL, SPEAK, ACTIVE_STATE, true);
+}
+
+//------------------------------------------------------------------------------
+void
+ConfigDatabase::save()
+{
+ CLASSCERR("ConfigDatabase::save");
+
+ DBWriteContactSettingString(NULL, SPEAK, ENGINE, m_voice_desc.engine.c_str());
+ DBWriteContactSettingString(NULL, SPEAK, VOICE, m_voice_desc.voice.c_str());
+ DBWriteContactSettingDword(NULL, SPEAK, VOLUME, m_voice_desc.volume);
+ DBWriteContactSettingDword(NULL, SPEAK, PITCH, m_voice_desc.pitch);
+ DBWriteContactSettingDword(NULL, SPEAK, RATE, m_voice_desc.rate);
+
+ DBWriteContactSettingDword(NULL, SPEAK, ACTIVE_FLAGS, m_active_flags);
+
+ DBWriteContactSettingString(NULL, SPEAK, WELCOME_MSG, m_welcome_msg.c_str());
+
+ for (ActiveUsersMap::iterator i = m_active_users.begin();
+ i != m_active_users.end(); ++i)
+ {
+ DBWriteContactSettingByte(i->first, SPEAK, ACTIVE_STATE, i->second);
+ }
+
+ // notify the subjects that things have changed
+ notify();
+}
+
+//------------------------------------------------------------------------------
+// private:
+//------------------------------------------------------------------------------
+std::string
+ConfigDatabase::DBGetContactSettingString(const char *szModule,
+ const char *szSetting, const char *def)
+{
+ std::string ret = def;
+ DBVARIANT dbv;
+
+ if (!DBGetContactSetting(NULL, szModule, szSetting, &dbv))
+ {
+ ret = dbv.pszVal;
+ }
+
+ return ret;
+}
+
+//==============================================================================
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/config/config_database.h b/plugins/!NotAdopted/WinterSpeak/speak/config/config_database.h
new file mode 100644
index 0000000000..716745a3ce
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/config/config_database.h
@@ -0,0 +1,91 @@
+#ifndef guard_speak_config_config_database_h
+#define guard_speak_config_config_database_h
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#include "defs/voice_desc.h"
+
+#include <general/observer/subject.h>
+
+#include <windows.h>
+#include <string>
+#include <map>
+
+class ConfigDatabase : public Subject
+{
+ public:
+ ConfigDatabase();
+ ~ConfigDatabase();
+
+ enum ActiveFlag
+ {
+ ActiveFlag_Online = 1,
+ ActiveFlag_Away,
+ ActiveFlag_Dnd,
+ ActiveFlag_Na,
+ ActiveFlag_Occupied,
+ ActiveFlag_FreeForChat,
+ ActiveFlag_Invisible
+ };
+
+ typedef std::map<HANDLE, bool> ActiveUsersMap;
+
+ //--------------------------------------------------------------------------
+ // Description : get/set the voice description
+ //--------------------------------------------------------------------------
+ VoiceDesc getVoiceDesc() const { return m_voice_desc; }
+ void setVoiceDesc(const VoiceDesc &desc) { m_voice_desc = desc; }
+
+ //--------------------------------------------------------------------------
+ // Description : get/set the welcome message
+ //--------------------------------------------------------------------------
+ const std::string & getWelcomeMessage() const { return m_welcome_msg; }
+ void setWelcomeMessage(const std::string &msg) { m_welcome_msg = msg; }
+
+ //--------------------------------------------------------------------------
+ // Description : get/set an status flags
+ //--------------------------------------------------------------------------
+ bool getActiveFlag(ActiveFlag flag) const;
+ void setActiveFlag(ActiveFlag flag, bool state);
+
+ //--------------------------------------------------------------------------
+ // Description : get/set the user active flag
+ //--------------------------------------------------------------------------
+ bool getActiveUser(HANDLE user) const;
+ void setActiveUser(HANDLE user, bool state);
+ ActiveUsersMap getActiveUsers() const { return m_active_users; }
+
+ //--------------------------------------------------------------------------
+ // Description : load/save the settings from the miranda database
+ //--------------------------------------------------------------------------
+ void load();
+ void save();
+
+ private:
+ //--------------------------------------------------------------------------
+ // Description : For some reason this isn't implemented in miranda yet
+ // Just get a string from the db
+ // Parameters : szModule - the entrys' module
+ // szSetting - the entrys' setting
+ // def - default string if entry doesn't exist
+ //--------------------------------------------------------------------------
+ static std::string DBGetContactSettingString(const char *szModule,
+ const char *szSetting, const char *def);
+
+ VoiceDesc m_voice_desc;
+ unsigned int m_active_flags;
+ std::string m_welcome_msg;
+ ActiveUsersMap m_active_users;
+};
+
+//==============================================================================
+//
+// Summary : encapsulate the access to the miranda database
+//
+// Description : Provide a subject that allows clients to know when changes
+// are made to the miranda database.
+//
+//==============================================================================
+
+#endif \ No newline at end of file
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/config/dialog_config_active.cpp b/plugins/!NotAdopted/WinterSpeak/speak/config/dialog_config_active.cpp
new file mode 100644
index 0000000000..9d261adc24
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/config/dialog_config_active.cpp
@@ -0,0 +1,234 @@
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#pragma warning(disable:4786)
+
+#include "dialog_config_active.h"
+
+#include "speak.h"
+#include "resource.h"
+
+#include <general/debug/debug.h>
+
+#include <windows.h>
+#include <commctrl.h>
+
+//------------------------------------------------------------------------------
+DialogConfigActive *DialogConfigActive::m_instance = 0;
+
+//------------------------------------------------------------------------------
+// public:
+//------------------------------------------------------------------------------
+DialogConfigActive::DialogConfigActive(ConfigDatabase &db)
+ :
+ m_db(db)
+{
+ CLASSCERR("DialogConfigActive::DialogConfigActive");
+
+ m_instance = this;
+}
+
+//------------------------------------------------------------------------------
+DialogConfigActive::~DialogConfigActive()
+{
+ CLASSCERR("DialogConfigActive::~DialogConfigActive");
+
+ m_instance = 0;
+}
+
+//------------------------------------------------------------------------------
+int CALLBACK
+DialogConfigActive::process(HWND window, UINT message, WPARAM wparam,
+ LPARAM lparam)
+{
+ if (!m_instance)
+ {
+ return 1;
+ }
+
+ switch (message)
+ {
+ case WM_INITDIALOG:
+ m_instance->load(window);
+ break;
+
+ case WM_NOTIFY:
+ switch (reinterpret_cast<LPNMHDR>(lparam)->code)
+ {
+ case PSN_APPLY:
+ m_instance->save(window);
+ break;
+
+ case LVN_ITEMCHANGED:
+ m_instance->changed(window);
+ break;
+ }
+ break;
+
+ case WM_COMMAND:
+ switch (LOWORD(wparam))
+ {
+ case IDC_ACTIVE_OFFLINE:
+ case IDC_ACTIVE_ONLINE:
+ case IDC_ACTIVE_AWAY:
+ case IDC_ACTIVE_DND:
+ case IDC_ACTIVE_NA:
+ case IDC_ACTIVE_OCCUPIED:
+ case IDC_ACTIVE_FREEFORCHAT:
+ case IDC_ACTIVE_INVISIBLE:
+ m_instance->changed(window);
+ break;
+
+ case IDC_ACTIVE_ALL:
+ m_instance->selectAllUsers(window, true);
+ break;
+
+ case IDC_ACTIVE_NONE:
+ m_instance->selectAllUsers(window, false);
+ break;
+
+ case IDC_ACTIVE_USERS:
+ m_instance->changed(window);
+ break;
+ }
+ break;
+ }
+
+ return 0;
+}
+
+//------------------------------------------------------------------------------
+// private:
+//------------------------------------------------------------------------------
+void
+DialogConfigActive::load(HWND window)
+{
+ CLASSCERR("DialogConfigActive::load");
+
+ TranslateDialogDefault(window);
+
+ // initialise the checkboxes
+ CheckDlgButton(window, IDC_ACTIVE_ONLINE,
+ m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Online));
+ CheckDlgButton(window, IDC_ACTIVE_AWAY,
+ m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Away));
+ CheckDlgButton(window, IDC_ACTIVE_DND,
+ m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Dnd));
+ CheckDlgButton(window, IDC_ACTIVE_NA,
+ m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Na));
+ CheckDlgButton(window, IDC_ACTIVE_OCCUPIED,
+ m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Occupied));
+ CheckDlgButton(window, IDC_ACTIVE_FREEFORCHAT,
+ m_db.getActiveFlag(ConfigDatabase::ActiveFlag_FreeForChat));
+ CheckDlgButton(window, IDC_ACTIVE_INVISIBLE,
+ m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Invisible));
+
+ // add all the users active states
+ ConfigDatabase::ActiveUsersMap active_users = m_db.getActiveUsers();
+
+ HWND listview = GetDlgItem(window, IDC_ACTIVE_USERS);
+
+ // add checkboxes
+ ListView_SetExtendedListViewStyle(listview, LVS_EX_CHECKBOXES);
+
+ LV_ITEM lv_item;
+ lv_item.mask = LVIF_TEXT | LVIF_PARAM;
+ lv_item.iSubItem = 0;
+
+ int index = 0;
+ ConfigDatabase::ActiveUsersMap::const_iterator iter;
+ for (iter = active_users.begin(); iter != active_users.end(); ++iter)
+ {
+ lv_item.lParam = (LPARAM)iter->first;
+ std::string str = "";
+
+ // if its index 0, the use its the unknown user
+ if (0 == lv_item.lParam)
+ {
+ lv_item.pszText = "Unknown";
+ }
+ else
+ {
+ char *protocol = reinterpret_cast<char *>(
+ CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)iter->first,0));
+
+ if (protocol)
+ {
+ str += protocol;
+ str += ": ";
+ }
+
+ str += reinterpret_cast<char *>(
+ CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)iter->first, 0));
+
+ lv_item.pszText = const_cast<char *>(str.c_str());
+ }
+ lv_item.iItem = index++;
+
+ int it = ListView_InsertItem(listview, &lv_item);
+ ListView_SetCheckState(listview, it, iter->second);
+ }
+}
+
+//------------------------------------------------------------------------------
+void
+DialogConfigActive::save(HWND window)
+{
+ CLASSCERR("DialogConfigActive::save");
+
+ // store the checkboxes
+ m_db.setActiveFlag(ConfigDatabase::ActiveFlag_Online,
+ (IsDlgButtonChecked(window, IDC_ACTIVE_ONLINE) != 0));
+ m_db.setActiveFlag(ConfigDatabase::ActiveFlag_Away,
+ (IsDlgButtonChecked(window, IDC_ACTIVE_AWAY) != 0));
+ m_db.setActiveFlag(ConfigDatabase::ActiveFlag_Dnd,
+ (IsDlgButtonChecked(window, IDC_ACTIVE_DND) != 0));
+ m_db.setActiveFlag(ConfigDatabase::ActiveFlag_Na,
+ (IsDlgButtonChecked(window, IDC_ACTIVE_NA) != 0));
+ m_db.setActiveFlag(ConfigDatabase::ActiveFlag_Occupied,
+ (IsDlgButtonChecked(window, IDC_ACTIVE_OCCUPIED) != 0));
+ m_db.setActiveFlag(ConfigDatabase::ActiveFlag_FreeForChat,
+ (IsDlgButtonChecked(window, IDC_ACTIVE_FREEFORCHAT) != 0));
+ m_db.setActiveFlag(ConfigDatabase::ActiveFlag_Invisible,
+ (IsDlgButtonChecked(window, IDC_ACTIVE_INVISIBLE) != 0));
+
+ // look through the listview an extract the active users
+ HWND listview = GetDlgItem(window, IDC_ACTIVE_USERS);
+
+ LV_ITEM lv_item;
+ lv_item.mask = LVIF_PARAM;
+ lv_item.iSubItem = 0;
+
+ for (int i = 0; i < ListView_GetItemCount(listview); ++i)
+ {
+ lv_item.iItem = i;
+
+ if (TRUE == ListView_GetItem(listview, &lv_item))
+ {
+ m_db.setActiveUser((HANDLE)lv_item.lParam,
+ ListView_GetCheckState(listview, i));
+ }
+ }
+
+ m_db.save();
+}
+
+//------------------------------------------------------------------------------
+void
+DialogConfigActive::selectAllUsers(HWND window, bool state)
+{
+ CLASSCERR("DialogConfigActive::selectAllUsers");
+ // look through the listview an extract the active users
+
+ HWND listview = GetDlgItem(window, IDC_ACTIVE_USERS);
+
+ for (int i = 0; i < ListView_GetItemCount(listview); ++i)
+ {
+ ListView_SetCheckState(listview, i, state);
+ }
+
+ changed(window);
+}
+
+//==============================================================================
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/config/dialog_config_active.h b/plugins/!NotAdopted/WinterSpeak/speak/config/dialog_config_active.h
new file mode 100644
index 0000000000..5e0c0e2403
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/config/dialog_config_active.h
@@ -0,0 +1,56 @@
+#ifndef guard_speak_config_dialog_config_active_h
+#define guard_speak_config_dialog_config_active_h
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#include "dialog/miranda_dialog.h"
+#include "config/config_database.h"
+
+#include <wtypes.h>
+
+class DialogConfigActive : public MirandaDialog
+{
+ public:
+ //--------------------------------------------------------------------------
+ // Description : Initialise
+ // Parameters : db - reference to the database to initalise and save
+ // control to and from
+ //--------------------------------------------------------------------------
+ DialogConfigActive(ConfigDatabase &db);
+ virtual ~DialogConfigActive();
+
+ //--------------------------------------------------------------------------
+ // Description : process a dialog message
+ // Return : 0 - process ok
+ // 1 - error
+ //--------------------------------------------------------------------------
+ static int CALLBACK process(HWND window, UINT message, WPARAM wparam,
+ LPARAM lparam);
+
+ private:
+ //--------------------------------------------------------------------------
+ // Description : load/save setting to the miranda database
+ //--------------------------------------------------------------------------
+ void load(HWND window);
+ void save(HWND window);
+
+ //--------------------------------------------------------------------------
+ // Description : select/unselect all the active status checkboxes
+ // Parameters : state - the state to apply to the checkboxes
+ //--------------------------------------------------------------------------
+ void selectAllUsers(HWND window, bool state);
+
+ static DialogConfigActive *m_instance;
+ ConfigDatabase &m_db;
+};
+
+//==============================================================================
+//
+// Summary : Configuration Engine Dialog box
+//
+// Description : Set up the configuration dialog box and process its input
+//
+//==============================================================================
+
+#endif \ No newline at end of file
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/config/dialog_config_engine.cpp b/plugins/!NotAdopted/WinterSpeak/speak/config/dialog_config_engine.cpp
new file mode 100644
index 0000000000..d95e610916
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/config/dialog_config_engine.cpp
@@ -0,0 +1,289 @@
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#pragma warning(disable:4786)
+
+#include "dialog_config_engine.h"
+
+#include "speak.h"
+#include "resource.h"
+#include "config/speech_interface.h"
+
+#include <general/debug/debug.h>
+#include <general/text_to_speech/text_to_speech/text_to_speech.h>
+
+#include <windows.h>
+#include <commctrl.h>
+
+//------------------------------------------------------------------------------
+DialogConfigEngine *DialogConfigEngine::m_instance = 0;
+
+//------------------------------------------------------------------------------
+// public:
+//------------------------------------------------------------------------------
+DialogConfigEngine::DialogConfigEngine(ConfigDatabase &db)
+ :
+ m_db(db),
+ m_test_tts(0)
+{
+ CLASSCERR("DialogConfigEngine::DialogConfigEngine");
+
+ m_instance = this;
+}
+
+//------------------------------------------------------------------------------
+DialogConfigEngine::~DialogConfigEngine()
+{
+ CLASSCERR("DialogConfigEngine::~DialogConfigEngine");
+
+ m_instance = 0;
+}
+
+//------------------------------------------------------------------------------
+int CALLBACK
+DialogConfigEngine::process(HWND window, UINT message, WPARAM wparam,
+ LPARAM lparam)
+{
+ if (!m_instance)
+ {
+ return 1;
+ }
+
+ switch (message)
+ {
+ case WM_INITDIALOG:
+ m_instance->load(window);
+ break;
+
+ case WM_NOTIFY:
+ if (PSN_APPLY == reinterpret_cast<LPNMHDR>(lparam)->code)
+ {
+ m_instance->save(window);
+ m_instance->m_db.save();
+ }
+ break;
+
+ case WM_HSCROLL:
+ m_instance->changed(window);
+ break;
+
+ case WM_COMMAND:
+ m_instance->command(window, wparam);
+ break;
+ }
+
+ return 0;
+}
+
+//------------------------------------------------------------------------------
+// private:
+//------------------------------------------------------------------------------
+void
+DialogConfigEngine::command(HWND window, int control)
+{
+ switch (LOWORD(control))
+ {
+ case IDC_WELCOME_MSG:
+ if (EN_CHANGE == HIWORD(control))
+ {
+ changed(window);
+ }
+ break;
+
+ case IDC_SELECT_VOICE:
+ if (CBN_SELCHANGE == HIWORD(control))
+ {
+ changed(window);
+ }
+ break;
+
+ case IDC_SELECT_ENGINE:
+ if (CBN_SELCHANGE == HIWORD(control))
+ {
+ updateVoices(window);
+ changed(window);
+ }
+ break;
+
+ case IDC_CONFIG_LEXICON:
+ if (createTts(window))
+ {
+ if (!m_test_tts->lexiconDialog(window))
+ {
+ MessageBox(window, "Lexicon for this engine is not supported",
+ "Speak", MB_OK | MB_ICONEXCLAMATION);
+ }
+ }
+ break;
+
+ case IDC_BUTTON_TEST:
+ if (createTts(window))
+ {
+ m_test_tts->say(Translate("testing testing 1 2 3"));
+ }
+ break;
+ }
+}
+
+//------------------------------------------------------------------------------
+void
+DialogConfigEngine::load(HWND window)
+{
+ CLASSCERR("DialogConfigEngine::load()");
+
+ TranslateDialogDefault(window);
+
+ // add the available engines to the combo box
+ SpeechInterface si;
+ std::vector<std::string> engines = si.getAvailableEngines();
+ for (unsigned int i = 0; i < engines.size(); ++i)
+ {
+ CLASSCERR("DialogConfigEngine::load adding " << engines[i].c_str());
+
+ SendDlgItemMessage(window, IDC_SELECT_ENGINE, CB_ADDSTRING, 0,
+ (long)engines[i].c_str());
+ }
+
+ VoiceDesc desc = m_db.getVoiceDesc();
+
+ // initialise the sliders
+ SendDlgItemMessage(window, IDC_SLIDER_VOLUME, TBM_SETPOS, TRUE,
+ desc.volume);
+ SendDlgItemMessage(window, IDC_SLIDER_PITCH, TBM_SETPOS, TRUE,
+ desc.pitch);
+ SendDlgItemMessage(window, IDC_SLIDER_RATE, TBM_SETPOS, TRUE,
+ desc.rate);
+
+ // select the speech engine
+ SendDlgItemMessage(window, IDC_SELECT_ENGINE, CB_SELECTSTRING, 0,
+ reinterpret_cast<long>(desc.engine.c_str()));
+
+ // initialise the welcome message box
+ SetDlgItemText(window, IDC_WELCOME_MSG, m_db.getWelcomeMessage().c_str());
+
+ updateVoices(window);
+}
+
+//------------------------------------------------------------------------------
+void
+DialogConfigEngine::save(HWND window)
+{
+ CLASSCERR("DialogConfigEngine::save()");
+
+ VoiceDesc desc;
+ getVoiceDesc(window, desc);
+ m_db.setVoiceDesc(desc);
+
+ // store the welcome message
+ char text[512];
+ GetDlgItemText(window, IDC_WELCOME_MSG, text, sizeof(text));
+ m_db.setWelcomeMessage(std::string(text));
+}
+
+//------------------------------------------------------------------------------
+void
+DialogConfigEngine::updateVoices(HWND window)
+{
+ CLASSCERR("DialogConfigEngine::updateVoices()");
+
+ SpeechInterface si;
+ m_test_tts = std::auto_ptr<TextToSpeech>(si.createTts(getEngine(window)));
+
+ if (!m_test_tts.get())
+ {
+ // we couldnt open the text to speech engine
+ CLASSCERR("DialogConfigEngine::updateVoices invalid tts");
+ return;
+ }
+
+ // add the voices onto the list
+ std::vector<std::string> voices = m_test_tts->getVoices();
+
+ SendDlgItemMessage(window, IDC_SELECT_VOICE, CB_RESETCONTENT, 0, 0);
+ for (unsigned int i = 0; i < voices.size(); ++i)
+ {
+ SendDlgItemMessage(window, IDC_SELECT_VOICE, CB_ADDSTRING, 0,
+ (long)voices[i].c_str());
+ }
+
+ // get the voice saved in the database
+ std::string voice = m_db.getVoiceDesc().voice;
+
+ if (FAILED(SendDlgItemMessage(window, IDC_SELECT_VOICE,
+ CB_FINDSTRINGEXACT, 0, (long)voice.c_str())))
+ {
+ // select the first one
+ SendDlgItemMessage(window, IDC_SELECT_VOICE, CB_SETCURSEL , 0, 0);
+ }
+ else
+ {
+ // select the saved voice
+ SendDlgItemMessage(window, IDC_SELECT_VOICE, CB_SELECTSTRING, 0,
+ (long)voice.c_str());
+ }
+}
+
+//------------------------------------------------------------------------------
+void
+DialogConfigEngine::getVoiceDesc(HWND window, VoiceDesc &desc)
+{
+ CLASSCERR("DialogConfigEngine::getVoiceDesc(,)");
+
+ // get the engine
+ char text[100];
+ GetDlgItemText(window, IDC_SELECT_ENGINE, text, sizeof(text));
+ desc.engine = std::string(text);
+
+ // get the voice
+ std::auto_ptr<char> voice(new char[50]);
+ SendDlgItemMessage(window, IDC_SELECT_VOICE, CB_GETLBTEXT,
+ SendDlgItemMessage(window, IDC_SELECT_VOICE, CB_GETCURSEL, 0, 0),
+ reinterpret_cast<long>(voice.get()));
+ desc.voice = voice.get();
+
+ // get the voice setting sliders
+ desc.volume
+ = SendDlgItemMessage(window, IDC_SLIDER_VOLUME, TBM_GETPOS, 0, 0);
+ desc.pitch
+ = SendDlgItemMessage(window, IDC_SLIDER_PITCH, TBM_GETPOS, 0, 0);
+ desc.rate
+ = SendDlgItemMessage(window, IDC_SLIDER_RATE, TBM_GETPOS, 0, 0);
+}
+
+//------------------------------------------------------------------------------
+std::string
+DialogConfigEngine::getEngine(HWND window)
+{
+ CLASSCERR("DialogConfigEngine::getEngine()");
+
+ // store the engine
+ char text[100];
+ GetDlgItemText(window, IDC_SELECT_ENGINE, text, sizeof(text));
+
+ CLASSCERR("DialogConfigEngine::getEngine() return " << text);
+ return text;
+}
+
+//------------------------------------------------------------------------------
+bool
+DialogConfigEngine::createTts(HWND window)
+{
+ CLASSCERR("DialogConfigEngine::createTts()");
+
+ VoiceDesc desc;
+ getVoiceDesc(window, desc);
+
+ SpeechInterface si;
+ m_test_tts = std::auto_ptr<TextToSpeech>(si.createTts(desc.engine));
+
+ if (!m_test_tts.get())
+ {
+ return false;
+ }
+
+ si.configureTts(m_test_tts.get(), desc);
+ return true;
+}
+
+//==============================================================================
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/config/dialog_config_engine.h b/plugins/!NotAdopted/WinterSpeak/speak/config/dialog_config_engine.h
new file mode 100644
index 0000000000..9aed91aa9b
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/config/dialog_config_engine.h
@@ -0,0 +1,59 @@
+#ifndef guard_speak_config_dialog_config_engine_h
+#define guard_speak_config_dialog_config_engine_h
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#include "dialog/miranda_dialog.h"
+#include "config/config_database.h"
+
+#include <wtypes.h>
+#include <memory>
+
+class TextToSpeech;
+
+class DialogConfigEngine : public MirandaDialog
+{
+ public:
+ DialogConfigEngine(ConfigDatabase &db);
+ virtual ~DialogConfigEngine();
+
+ //--------------------------------------------------------------------------
+ // Description : process a dialog message
+ // Return : 0 - process ok
+ // 1 - error
+ //--------------------------------------------------------------------------
+ static int CALLBACK process(HWND window, UINT message, WPARAM wparam,
+ LPARAM lparam);
+
+ private:
+ void command(HWND window, int control);
+
+ //--------------------------------------------------------------------------
+ // Description : load/save setting to the miranda database
+ //--------------------------------------------------------------------------
+ void load(HWND window);
+ void save(HWND window);
+
+ //--------------------------------------------------------------------------
+ // Description : update the voices combo box
+ //--------------------------------------------------------------------------
+ void updateVoices(HWND window);
+ void getVoiceDesc(HWND window, VoiceDesc &desc);
+ std::string getEngine(HWND window);
+ bool createTts(HWND window);
+
+ static DialogConfigEngine *m_instance;
+ ConfigDatabase &m_db;
+ std::auto_ptr<TextToSpeech> m_test_tts;
+};
+
+//==============================================================================
+//
+// Summary : Configuration Engine Dialog box
+//
+// Description : Set up the configuration dialog box and process its input
+//
+//==============================================================================
+
+#endif \ No newline at end of file
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/config/speak_config.cpp b/plugins/!NotAdopted/WinterSpeak/speak/config/speak_config.cpp
new file mode 100644
index 0000000000..c9f6bfdbde
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/config/speak_config.cpp
@@ -0,0 +1,170 @@
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#pragma warning(disable:4786)
+
+#include "speak_config.h"
+
+#include "defs/voice_desc.h"
+#include "config/speech_interface.h"
+#include "config/dialog_config_engine.h"
+#include "config/dialog_config_active.h"
+
+#include <general/debug/debug.h>
+#include <general/text_to_speech/text_to_speech/text_to_speech.h>
+//#include <general/multimedia/winamp_2/winamp_2.h>
+
+#include <sstream>
+
+//------------------------------------------------------------------------------
+// public:
+//------------------------------------------------------------------------------
+SpeakConfig::SpeakConfig(HINSTANCE instance)
+ :
+ m_instance(instance),
+ m_db(),
+ m_tts(0),
+ m_dialog_engine(m_db),
+ m_dialog_active(m_db)
+{
+ CLASSCERR("SpeakConfig::SpeakConfig");
+
+ // create and configure the tts
+ SpeechInterface si;
+ VoiceDesc desc = m_db.getVoiceDesc();
+ m_tts = std::auto_ptr<TextToSpeech>(si.createTts(desc.engine));
+ si.configureTts(m_tts.get(), desc);
+
+ // observer the database for changes
+ m_db.attach(*this);
+
+ say(m_db.getWelcomeMessage());
+}
+
+//------------------------------------------------------------------------------
+SpeakConfig::~SpeakConfig()
+{
+ CLASSCERR("SpeakConfig::~SpeakConfig");
+}
+
+//------------------------------------------------------------------------------
+void
+SpeakConfig::update(Subject &subject)
+{
+ CLASSCERR("SpeakConfig::update(" << &subject << ")");
+
+ ConfigDatabase &db = static_cast<ConfigDatabase &>(subject);
+
+ SpeechInterface si;
+ VoiceDesc desc = db.getVoiceDesc();
+ m_tts = std::auto_ptr<TextToSpeech>(si.createTts(desc.engine));
+ si.configureTts(m_tts.get(), desc);
+}
+
+//------------------------------------------------------------------------------
+bool
+SpeakConfig::say(const std::string &sentence, HANDLE user)
+{
+ CLASSCERR("SpeakConfig::say(" << sentence << ")");
+
+ if (!m_tts.get())
+ {
+ return false;
+ }
+
+ bool active = true;
+
+ if (NULL != user)
+ {
+ // get the status of the protocol of this user
+ const char *protocol = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO,
+ (WPARAM)user, 0);
+
+ if (ID_STATUS_OFFLINE == CallProtoService(protocol, PS_GETSTATUS, 0, 0))
+ {
+ // if we are offline for this protocol, then don't speak the
+ // sentence this is so we don't announce users offline status if
+ // we are disconnected.
+ active = false;
+ }
+ else
+ {
+ switch (CallService(MS_CLIST_GETSTATUSMODE, 0, 0))
+ {
+ case ID_STATUS_ONLINE:
+ active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Online);
+ break;
+ case ID_STATUS_AWAY:
+ active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Away);
+ break;
+ case ID_STATUS_DND:
+ active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Dnd);
+ break;
+ case ID_STATUS_NA:
+ active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Na);
+ break;
+ case ID_STATUS_OCCUPIED:
+ active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Occupied);
+ break;
+ case ID_STATUS_FREECHAT:
+ active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_FreeForChat);
+ break;
+ case ID_STATUS_INVISIBLE:
+ active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Invisible);
+ break;
+ default:
+ active = false;
+ break;
+ }
+ }
+
+ // if its a user say, then check the users status
+ if (active && (NULL != user))
+ {
+ active = m_db.getActiveUser(user);
+ }
+ }
+
+ if (!active)
+ {
+ return false;
+ }
+
+ bool ret = m_tts->say(sentence);
+
+ return ret;
+}
+
+//------------------------------------------------------------------------------
+/*int
+SpeakConfig::dialogEngine(HWND window, unsigned int message, WPARAM wparam,
+ LPARAM lparam)
+{
+ if (WM_INITDIALOG == message)
+ {
+ m_dialog_engine = std::auto_ptr<DialogConfigEngine>
+ (new DialogConfigEngine(window, m_db));
+ }
+ else if (WM_DESTROY == message)
+ {
+ m_dialog_engine = std::auto_ptr<DialogConfigEngine>(0);
+ }
+
+ if (!m_dialog_engine.get())
+ {
+ return 1;
+ }
+
+ // process the message and if settings are changed, reload the tts
+ if (m_dialog_engine->process(message, wparam, lparam))
+ {
+ m_db.load();
+ SpeechInterface si;
+ m_tts = std::auto_ptr<TextToSpeech>(si.createTts(m_db.getVoiceDesc()));
+ }
+
+ return 0;
+}*/
+
+//==============================================================================
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/config/speak_config.h b/plugins/!NotAdopted/WinterSpeak/speak/config/speak_config.h
new file mode 100644
index 0000000000..c664c9d9d8
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/config/speak_config.h
@@ -0,0 +1,59 @@
+#ifndef guard_speak_config_speak_config_h
+#define guard_speak_config_speak_config_h
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#include "speak.h"
+#include "config/config_database.h"
+#include "config/dialog_config_active.h"
+#include "config/dialog_config_engine.h"
+
+#include <general/observer/observer.h>
+
+#include <wtypes.h>
+#include <memory>
+
+class TextToSpeech;
+
+class SpeakConfig : public Observer
+{
+ public:
+ SpeakConfig(HINSTANCE instance);
+ virtual ~SpeakConfig();
+
+ //--------------------------------------------------------------------------
+ // Description : Called by a subject that this observer is observing
+ // to signify a change in state
+ // Parameters : subject - the subject that changed
+ //--------------------------------------------------------------------------
+ virtual void update(Subject &subject);
+
+ //--------------------------------------------------------------------------
+ // Description : speak a sentence
+ // Parameters : sentence - the sentence to speak
+ // user - the user to associate the say with
+ // NULL = ignore user
+ // Returns : true - speak successful
+ // false - speak failed
+ //--------------------------------------------------------------------------
+ bool say(const std::string &sentence, HANDLE user = NULL);
+
+ private:
+ HINSTANCE m_instance;
+
+ ConfigDatabase m_db;
+ std::auto_ptr<TextToSpeech> m_tts;
+ DialogConfigEngine m_dialog_engine;
+ DialogConfigActive m_dialog_active;
+};
+
+//==============================================================================
+//
+// Summary : The main object for the speak plugins
+//
+// Description : see summary
+//
+//==============================================================================
+
+#endif \ No newline at end of file
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/config/speech_interface.cpp b/plugins/!NotAdopted/WinterSpeak/speak/config/speech_interface.cpp
new file mode 100644
index 0000000000..c80a219165
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/config/speech_interface.cpp
@@ -0,0 +1,91 @@
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#pragma warning(disable:4786)
+
+#include "speech_interface.h"
+
+#include "config/config_database.h"
+
+#include <general/debug/debug.h>
+#include <general/text_to_speech/speech_api_40a/speech_api_40a.h>
+#include <general/text_to_speech/speech_api_51/speech_api_51.h>
+
+//------------------------------------------------------------------------------
+// public:
+//------------------------------------------------------------------------------
+SpeechInterface::SpeechInterface()
+{
+ CLASSCERR("SpeechInterface::SpeechInterface");
+}
+
+//------------------------------------------------------------------------------
+SpeechInterface::~SpeechInterface()
+{
+ CLASSCERR("SpeechInterface::~SpeechInterface");
+}
+
+//------------------------------------------------------------------------------
+TextToSpeech *
+SpeechInterface::createTts(std::string &engine) const
+{
+ CLASSCERR("SpeechInterface::createTts()");
+
+ TextToSpeech *tts = 0;
+
+ if (SpeechApi40a::getDescription() == engine)
+ {
+ tts = new SpeechApi40a();
+ }
+ else if (SpeechApi51::getDescription() == engine)
+ {
+ tts = new SpeechApi51();
+ }
+
+ CLASSCERR("SpeechInterface::createTts() return " << tts);
+ return tts;
+}
+
+//------------------------------------------------------------------------------
+void
+SpeechInterface::configureTts(TextToSpeech *tts, const VoiceDesc &desc) const
+{
+ CLASSCERR("SpeechInterface::configureTts(" << tts << ",)");
+
+ if (!tts)
+ {
+ return;
+ }
+
+ tts->setVoice(desc.voice);
+ tts->setVolume(desc.volume);
+ tts->setRate(desc.rate);
+ tts->setPitch(desc.pitch);
+ tts->load();
+}
+
+//------------------------------------------------------------------------------
+std::vector<std::string>
+SpeechInterface::getAvailableEngines()
+{
+ CLASSCERR("SpeechInterface::getAvailableEngines");
+
+ std::vector<std::string> engines;
+
+ SpeechApi40a sapi40a;
+ if (sapi40a.isAvailable())
+ {
+ engines.push_back(SpeechApi40a::getDescription());
+ }
+
+ SpeechApi51 sapi51;
+ if (sapi51.isAvailable())
+ {
+ engines.push_back(SpeechApi51::getDescription());
+ }
+
+ return engines;
+}
+
+//==============================================================================
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/config/speech_interface.h b/plugins/!NotAdopted/WinterSpeak/speak/config/speech_interface.h
new file mode 100644
index 0000000000..69d2d44e14
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/config/speech_interface.h
@@ -0,0 +1,48 @@
+#ifndef guard_speak_config_speech_interface_h
+#define guard_speak_config_speech_interface_h
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#include "defs/voice_desc.h"
+
+#include <string>
+#include <vector>
+
+class TextToSpeech;
+
+class SpeechInterface
+{
+ public:
+ SpeechInterface();
+ ~SpeechInterface();
+
+ //--------------------------------------------------------------------------
+ // Description : create the text to speech object
+ // Parameters : engine - the name of the engine to create
+ // Returns : an instance of the text to speech engine
+ //--------------------------------------------------------------------------
+ TextToSpeech * createTts(std::string &engine) const;
+
+ //--------------------------------------------------------------------------
+ // Description : configure the tts object
+ // Parameters : tts - the tts object to configure
+ // desc - the description of the voice
+ //--------------------------------------------------------------------------
+ void configureTts(TextToSpeech *tts, const VoiceDesc &desc) const;
+
+ //--------------------------------------------------------------------------
+ // Description : create a vector of available engines
+ //--------------------------------------------------------------------------
+ std::vector<std::string> getAvailableEngines();
+};
+
+//==============================================================================
+//
+// Summary : Configure a text to speech object
+//
+// Description : Encapsulate the different speech engines available
+//
+//==============================================================================
+
+#endif \ No newline at end of file
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/defs/voice_desc.h b/plugins/!NotAdopted/WinterSpeak/speak/defs/voice_desc.h
new file mode 100644
index 0000000000..9edde585e8
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/defs/voice_desc.h
@@ -0,0 +1,26 @@
+#ifndef guard_speak_defs_voice_desc_h
+#define guard_speak_defs_voice_desc_h
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#include <string>
+
+struct VoiceDesc
+{
+ std::string engine;
+ std::string voice;
+ int volume;
+ int pitch;
+ int rate;
+};
+
+//==============================================================================
+//
+// Summary : struct describing a voice
+//
+// Description :
+//
+//==============================================================================
+
+#endif \ No newline at end of file
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/dialog/miranda_dialog.cpp b/plugins/!NotAdopted/WinterSpeak/speak/dialog/miranda_dialog.cpp
new file mode 100644
index 0000000000..bdd222f31d
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/dialog/miranda_dialog.cpp
@@ -0,0 +1,36 @@
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#pragma warning(disable:4786)
+
+#include "miranda_dialog.h"
+
+//------------------------------------------------------------------------------
+//MirandaDialog *AnnounceDialog::m_instance = 0;
+//std::list<HWND, MirandaDialog *> MirandaDialog::m_window_list = 0;
+
+//------------------------------------------------------------------------------
+// public:
+//------------------------------------------------------------------------------
+MirandaDialog::MirandaDialog()
+// :
+// m_window(0)
+{
+}
+
+//------------------------------------------------------------------------------
+MirandaDialog::~MirandaDialog()
+{
+}
+
+//------------------------------------------------------------------------------
+// protected:
+//------------------------------------------------------------------------------
+void
+MirandaDialog::changed(HWND window)
+{
+ SendMessage(GetParent(window), PSM_CHANGED, 0, 0);
+}
+
+//============================================================================== \ No newline at end of file
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/dialog/miranda_dialog.h b/plugins/!NotAdopted/WinterSpeak/speak/dialog/miranda_dialog.h
new file mode 100644
index 0000000000..833e277434
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/dialog/miranda_dialog.h
@@ -0,0 +1,59 @@
+#ifndef guard_speak_dialog_miranda_dialog_h
+#define guard_speak_dialog_miranda_dialog_h
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#include <windows.h>
+
+#include <map>
+
+class MirandaDialog
+{
+ public:
+// MirandaDialog(HWND window);
+ MirandaDialog();
+ virtual ~MirandaDialog() = 0;
+
+ protected:
+ //--------------------------------------------------------------------------
+ // Description : set the window the dialog events are coming from
+ //--------------------------------------------------------------------------
+/* void setWindow(HWND window)
+ {
+ m_window = window;
+ }
+
+ HWND getWindow()
+ {
+ return m_window;
+ }*/
+
+ //--------------------------------------------------------------------------
+ // Description : return a pointer to the class object
+ //--------------------------------------------------------------------------
+// MirandaDialog * instance()
+// {
+// return m_instance;
+// }
+// MirandaDialog * instance(HWND window);
+
+ //--------------------------------------------------------------------------
+ // Description : flag that a dialog control has changed
+ //--------------------------------------------------------------------------
+ void changed(HWND window);
+
+// static std::map<HWND, MirandaDialog *> m_window_map;
+
+// HWND m_window;
+};
+
+//==============================================================================
+//
+// Summary : Abstract base class for the dialog forms
+//
+// Description : Implement common code
+//
+//==============================================================================
+
+#endif \ No newline at end of file
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/m_speak.h b/plugins/!NotAdopted/WinterSpeak/speak/m_speak.h
new file mode 100644
index 0000000000..94b84bcbcd
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/m_speak.h
@@ -0,0 +1,18 @@
+#ifndef guard_m_speak_h
+#define guard_m_speak_h
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#define ME_SPEAK_SAY "Speak/Say"
+
+//==============================================================================
+//
+// Summary : speak miranda includes
+//
+// Description : The includes need to be guarded to avoid multiple declaration
+// errors
+//
+//==============================================================================
+
+#endif \ No newline at end of file
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/resource.h b/plugins/!NotAdopted/WinterSpeak/speak/resource.h
new file mode 100644
index 0000000000..e06bfd8431
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/resource.h
@@ -0,0 +1,57 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by speak.rc
+//
+#define IDD_CONFIG 101
+#define IDD_ANNOUNCE 102
+#define IDD_ACTIVEMODES 103
+#define IDC_SELECT_ENGINE 1001
+#define IDC_SELECT_VOICE 1002
+#define IDC_SLIDER_RATE 1003
+#define IDC_SLIDER_VOLUME 1004
+#define IDC_SLIDER_PITCH 1005
+#define IDC_LOAD_SAPI 1006
+#define IDC_WELCOME_MSG 1007
+#define IDC_ACTIVE_OFFLINE 1008
+#define IDC_ACTIVE_ONLINE 1009
+#define IDC_ACTIVE_AWAY 1010
+#define IDC_ACTIVE_DND 1011
+#define IDC_ACTIVE_NA 1012
+#define IDC_ACTIVE_OCCUPIED 1013
+#define IDC_ACTIVE_FREEFORCHAT 1014
+#define IDC_ACTIVE_INVISIBLE 1015
+#define IDC_BUTTON_TEST 1016
+#define IDC_STATUS_OFFLINE 1100
+#define IDC_STATUS_ONLINE 1101
+#define IDC_STATUS_AWAY 1102
+#define IDC_STATUS_DND 1103
+#define IDC_STATUS_NA 1104
+#define IDC_STATUS_OCCUPIED 1105
+#define IDC_STATUS_FREEFORCHAT 1106
+#define IDC_STATUS_INVISIBLE 1107
+#define IDC_SPEAK_STATUS_MSG 1108
+#define IDC_EVENT_MESSAGE 1109
+#define IDC_EVENT_URL 1110
+#define IDC_EVENT_FILE 1111
+#define IDC_EVENT_AUTHREQUEST 1112
+#define IDC_EVENT_ADDED 1113
+#define IDC_READ_MSG_LENGTH 1114
+#define IDC_MAX_MSG 1115
+#define IDC_DIALOG_OPEN 1116
+#define IDC_DIALOG_FOCUSED 1117
+#define IDC_ACTIVE_USERS 1118
+#define IDC_ACTIVE_ALL 1119
+#define IDC_ACTIVE_NONE 1120
+#define IDC_SUPPRESS_CONNECT 1121
+#define IDC_CONFIG_LEXICON 1122
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 104
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1123
+#define _APS_NEXT_SYMED_VALUE 104
+#endif
+#endif
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/speak.cpp b/plugins/!NotAdopted/WinterSpeak/speak/speak.cpp
new file mode 100644
index 0000000000..d15641d532
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/speak.cpp
@@ -0,0 +1,238 @@
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#pragma warning(disable:4786)
+
+#include "speak.h"
+#include "m_speak.h"
+
+#include "resource.h"
+#include "config/speak_config.h"
+#include "announce/speak_announce.h"
+#include "announce/dialog_announce.h"
+#include "config/dialog_config_active.h"
+#include "config/dialog_config_engine.h"
+
+#include <general/debug/debug.h>
+#include <general/debug/debug_window.h>
+#include <general/debug/debug_file.h>
+#include <general/optimise/aggressive_optimise.h>
+
+//-----------------------------------------------------------------------------
+PLUGINLINK *pluginLink = 0;
+HINSTANCE g_hInst;
+
+SpeakConfig *g_speak_config = 0;
+SpeakAnnounce *g_speak_announce = 0;
+HANDLE g_dialog_options_initialise;
+HANDLE g_event_status_change;
+HANDLE g_event_message_added;
+HANDLE g_protocol_ack;
+
+PLUGININFO g_pluginInfo =
+{
+ sizeof(PLUGININFO),
+ "Speak",
+ PLUGIN_MAKE_VERSION(0,9,7,0),
+ "Miranda interface to the Microsoft Speech API",
+ "Ryan Winter",
+ "ryanwinter@hotmail.com",
+ "© 2002 Ryan Winter",
+ "",
+ 0,
+ 0
+};
+
+#ifdef _DEBUG
+ DebugWindow g_debug_window;
+// DebugFile g_debug_file;
+#endif
+
+
+//-----------------------------------------------------------------------------
+// Description : External hook
+//-----------------------------------------------------------------------------
+int say(WPARAM wParam, LPARAM lParam)
+{
+ return g_speak_config->say(
+ reinterpret_cast<char *>(lParam),
+ reinterpret_cast<HANDLE>(wParam));
+}
+
+//-----------------------------------------------------------------------------
+// Description : an status change event occured
+//-----------------------------------------------------------------------------
+int eventStatusChange(WPARAM wParam, LPARAM lParam)
+{
+ g_speak_announce->statusChange(
+ reinterpret_cast<DBCONTACTWRITESETTING *>(lParam),
+ reinterpret_cast<HANDLE>(wParam));
+
+ return 0;
+}
+
+//-----------------------------------------------------------------------------
+// Description : a message event occured
+//-----------------------------------------------------------------------------
+int eventMessageAdded(WPARAM wParam, LPARAM lParam)
+{
+ g_speak_announce->incomingEvent(
+ reinterpret_cast<HANDLE>(wParam),
+ reinterpret_cast<HANDLE>(lParam));
+
+ return 0;
+}
+
+//-----------------------------------------------------------------------------
+// Description : a messaging protocol changed state
+//-----------------------------------------------------------------------------
+int protocolAck(WPARAM wParam, LPARAM lParam)
+{
+ g_speak_announce->protocolAck(reinterpret_cast<ACKDATA *>(lParam));
+
+ return 0;
+}
+
+//-----------------------------------------------------------------------------
+// Description : request for dialog box
+//-----------------------------------------------------------------------------
+int dialogOptionsInitialise(WPARAM wParam,LPARAM lParam)
+{
+ OPTIONSDIALOGPAGE odp;
+
+ ZeroMemory(&odp, sizeof(odp));
+
+ odp.cbSize = sizeof(odp);
+ odp.position = 100000000;
+ odp.hInstance = g_hInst;
+ odp.pszGroup = Translate("Speak");
+
+ if (g_speak_config)
+ {
+ odp.pszTemplate = MAKEINTRESOURCE(IDD_CONFIG);
+ odp.pszTitle = Translate("Engine/Voice");
+ odp.pfnDlgProc = DialogConfigEngine::process;
+ CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp);
+
+ odp.pszTemplate = MAKEINTRESOURCE(IDD_ACTIVEMODES);
+ odp.pszTitle = Translate("Active Modes");
+ odp.pfnDlgProc = DialogConfigActive::process;
+ CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp);
+ }
+
+ if (g_speak_announce)
+ {
+ odp.pszTemplate = MAKEINTRESOURCE(IDD_ANNOUNCE);
+ odp.pszTitle = Translate("Announce");
+ odp.pfnDlgProc = AnnounceDialog::process;
+ CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp);
+ }
+
+ return 0;
+}
+
+//-----------------------------------------------------------------------------
+// Description : Return info about the plugin
+//-----------------------------------------------------------------------------
+extern "C" __declspec(dllexport) PLUGININFO *
+MirandaPluginInfo(DWORD mirandaVersion)
+{
+ return &g_pluginInfo;
+}
+
+//-----------------------------------------------------------------------------
+// Description : Construct the plugin
+//-----------------------------------------------------------------------------
+extern "C" int __declspec(dllexport)
+Load(PLUGINLINK *link)
+{
+ pluginLink = link;
+
+ if (!g_speak_config)
+ {
+ g_speak_config = new SpeakConfig(g_hInst);
+
+ // expose to allow miranda + plugins to access my speak routines
+ CreateServiceFunction("Speak/Say", say);
+ }
+
+ if (!g_speak_announce)
+ {
+ g_speak_announce = new SpeakAnnounce(g_hInst);
+
+ // tap into contact setting change event
+ g_event_status_change
+ = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, eventStatusChange);
+
+ // a new message event has occured
+ g_event_message_added = HookEvent(ME_DB_EVENT_ADDED, eventMessageAdded);
+
+ // a messaging protocol changed state
+ g_protocol_ack = HookEvent(ME_PROTO_ACK, protocolAck);
+
+ }
+
+ // a option dialog box request has occured
+ g_dialog_options_initialise
+ = HookEvent(ME_OPT_INITIALISE, dialogOptionsInitialise);
+
+ return 0;
+}
+
+//-----------------------------------------------------------------------------
+// Description : Destruct the plugin
+//-----------------------------------------------------------------------------
+extern "C" int __declspec(dllexport)
+Unload(void)
+{
+ UnhookEvent(g_dialog_options_initialise);
+
+ if (g_speak_config)
+ {
+ delete g_speak_config;
+ g_speak_config = 0;
+ }
+
+ if (g_speak_announce)
+ {
+ UnhookEvent(g_event_status_change);
+ UnhookEvent(g_event_message_added);
+ UnhookEvent(g_protocol_ack);
+
+ delete g_speak_announce;
+ g_speak_announce = 0;
+ }
+
+ return 0;
+}
+
+//-----------------------------------------------------------------------------
+// Description : Main line
+//-----------------------------------------------------------------------------
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID)
+{
+ CERR("================================================================");
+
+ DisableThreadLibraryCalls(hinstDLL);
+ g_hInst = hinstDLL;
+
+ // dispatch application messages
+/* MSG msg;
+
+ while(::GetMessage(&msg, NULL, 0, 0))
+ {
+ ::TranslateMessage(&msg);
+ ::DispatchMessage(&msg);
+ }*/
+
+ return TRUE;
+}
+
+//==============================================================================
+//
+// Summary : DLL interface
+//
+// Description : Define the interface to the miranda program
+//
+//==============================================================================
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/speak.dsp b/plugins/!NotAdopted/WinterSpeak/speak/speak.dsp
new file mode 100644
index 0000000000..ec62dcaa90
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/speak.dsp
@@ -0,0 +1,275 @@
+# Microsoft Developer Studio Project File - Name="speak" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=speak - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "speak.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "speak.mak" CFG="speak - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "speak - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "speak - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""$/miranda/plugins/speak/speak", OOBAAAAA"
+# PROP Scc_LocalPath "."
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "speak - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TESTPLUG_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I ".\\" /I "D:\PROJECT\MIRANDA\MIRANDA0100" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SPEAK_EXPORTS" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0xc09 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /base:"0x43500000" /dll /machine:I386 /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none /incremental:yes /debug /nodefaultlib
+
+!ELSEIF "$(CFG)" == "speak - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 1
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TESTPLUG_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /GX /Zi /Od /I ".\\" /I "D:\PROJECT\MIRANDA\MIRANDA0100" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SPEAK_EXPORTS" /FD /GZ /c
+# SUBTRACT CPP /X /Fr /YX
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0xc09 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /base:"0x43500000" /dll /incremental:no /debug /machine:I386 /out:"../../miranda0100/debug/plugins/speak.dll" /pdbtype:sept
+# SUBTRACT LINK32 /verbose /nodefaultlib
+
+!ENDIF
+
+# Begin Target
+
+# Name "speak - Win32 Release"
+# Name "speak - Win32 Debug"
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\checked.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\resource.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\speak.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\unchecked.ico
+# End Source File
+# End Group
+# Begin Group "Source"
+
+# PROP Default_Filter ""
+# Begin Group "config"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\config\config_database.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\config\config_database.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\config\dialog_config_active.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\config\dialog_config_active.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\config\dialog_config_engine.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\config\dialog_config_engine.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\config\speak_config.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\config\speak_config.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\config\speech_interface.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\config\speech_interface.h
+# End Source File
+# End Group
+# Begin Group "announce"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\announce\announce_database.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\announce\announce_database.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\announce\dialog_announce.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\announce\dialog_announce.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\announce\event_information.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\announce\event_information.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\announce\protocol_information.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\announce\protocol_information.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\announce\speak_announce.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\announce\speak_announce.h
+# End Source File
+# End Group
+# Begin Group "dialog"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\dialog\miranda_dialog.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\dialog\miranda_dialog.h
+# End Source File
+# End Group
+# Begin Group "defs"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\defs\voice_desc.h
+# End Source File
+# End Group
+# Begin Group "user"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\user\user_information.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\user\user_information.h
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\m_speak.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\speak.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\speak.h
+# End Source File
+# End Group
+# Begin Group "Package"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\package\langpack_speak.txt
+# End Source File
+# Begin Source File
+
+SOURCE=.\package\langpack_speak_german.txt
+# End Source File
+# Begin Source File
+
+SOURCE=.\package\langpack_speak_italian.txt
+# End Source File
+# Begin Source File
+
+SOURCE=.\package\langpack_speak_russian.txt
+# End Source File
+# Begin Source File
+
+SOURCE=.\package\Speak.txt
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/speak.dsw b/plugins/!NotAdopted/WinterSpeak/speak/speak.dsw
new file mode 100644
index 0000000000..db7ffd011c
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/speak.dsw
@@ -0,0 +1,79 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "general"=..\..\..\general\general.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+ begin source code control
+ "$/general", AIBAAAAA
+ ..\..\..\general
+ end source code control
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "main"=..\..\miranda0100\plugins\Speakv5\main.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "miranda32"=..\..\miranda0100\miranda32\miranda32.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "speak"=.\speak.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+ begin source code control
+ "$/miranda/plugins/speak", IOBAAAAA
+ .
+ end source code control
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name miranda32
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name general
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/speak.h b/plugins/!NotAdopted/WinterSpeak/speak/speak.h
new file mode 100644
index 0000000000..202faa6312
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/speak.h
@@ -0,0 +1,27 @@
+#ifndef guard_speak_speak_h
+#define guard_speak_speak_h
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#include <windows.h>
+
+#include <miranda32/random/plugins/newpluginapi.h>
+#include <miranda32/random/skin/m_skin.h>
+#include <miranda32/random/langpack/m_langpack.h>
+#include <miranda32/ui/contactlist/m_clist.h>
+#include <miranda32/ui/options/m_options.h>
+#include <miranda32/database/m_database.h>
+#include <miranda32/protocols/protocols/m_protocols.h>
+#include <miranda32/protocols/protocols/m_protosvc.h>
+
+//==============================================================================
+//
+// Summary : speak miranda includes
+//
+// Description : The includes need to be guarded to avoid multiple declaration
+// errors
+//
+//==============================================================================
+
+#endif \ No newline at end of file
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/speak.rc b/plugins/!NotAdopted/WinterSpeak/speak/speak.rc
new file mode 100644
index 0000000000..b902ccfff4
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/speak.rc
@@ -0,0 +1,266 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include <general/general.rc>
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "#include <general/general.rc>\r\n"
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// English (Australia) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENA)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_AUS
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_CONFIG DIALOGEX 0, 0, 314, 240
+STYLE DS_3DLOOK | WS_CHILD | WS_VISIBLE
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ GROUPBOX "Engine Settings",IDC_STATIC,64,45,185,113
+ COMBOBOX IDC_SELECT_VOICE,122,71,120,71,CBS_DROPDOWNLIST |
+ WS_VSCROLL | WS_TABSTOP
+ CONTROL "Slider1",IDC_SLIDER_VOLUME,"msctls_trackbar32",TBS_TOP |
+ TBS_NOTICKS | WS_TABSTOP,118,87,126,14
+ CONTROL "Slider1",IDC_SLIDER_RATE,"msctls_trackbar32",TBS_TOP |
+ TBS_NOTICKS | WS_TABSTOP,118,103,126,14
+ CONTROL "Slider1",IDC_SLIDER_PITCH,"msctls_trackbar32",TBS_TOP |
+ TBS_NOTICKS | WS_TABSTOP,118,120,126,14
+ LTEXT "Rate",IDC_STATIC,70,108,46,8
+ LTEXT "Volume",IDC_STATIC,70,92,47,8
+ LTEXT "Voice",IDC_STATIC,70,74,47,8
+ LTEXT "Pitch",IDC_STATIC,70,124,47,8
+ PUSHBUTTON "Test",IDC_BUTTON_TEST,141,139,47,14
+ LTEXT "Engine",IDC_STATIC,70,60,47,8
+ COMBOBOX IDC_SELECT_ENGINE,122,56,120,71,CBS_DROPDOWNLIST |
+ WS_VSCROLL | WS_TABSTOP
+ EDITTEXT IDC_WELCOME_MSG,72,170,170,14,ES_AUTOHSCROLL
+ GROUPBOX "Welcome Message",IDC_STATIC,64,160,185,30
+ PUSHBUTTON "Lexicon",IDC_CONFIG_LEXICON,193,139,50,14
+END
+
+IDD_ANNOUNCE DIALOG DISCARDABLE 0, 0, 314, 240
+STYLE WS_CHILD
+FONT 8, "MS Sans Serif"
+BEGIN
+ GROUPBOX "Message Events",IDC_STATIC,112,117,195,116
+ CONTROL "Read message if less characters than",
+ IDC_READ_MSG_LENGTH,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,120,131,150,10
+ EDITTEXT IDC_MAX_MSG,274,128,25,14,ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "Ignore event if message dialog is open",IDC_DIALOG_OPEN,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,142,181,10
+ GROUPBOX "Status Changes",IDC_STATIC,7,7,99,107
+ CONTROL "Offline",IDC_STATUS_OFFLINE,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,15,19,85,10
+ CONTROL "Online",IDC_STATUS_ONLINE,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,15,30,85,10
+ CONTROL "Away",IDC_STATUS_AWAY,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,15,41,85,10
+ CONTROL "Do not Disturb",IDC_STATUS_DND,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,15,52,85,10
+ CONTROL "Not Available",IDC_STATUS_NA,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,15,63,85,10
+ CONTROL "Occupied",IDC_STATUS_OCCUPIED,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,15,74,85,10
+ CONTROL "Free for Chat",IDC_STATUS_FREEFORCHAT,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,15,85,85,10
+ CONTROL "Invisible",IDC_STATUS_INVISIBLE,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,15,96,84,10
+ GROUPBOX "Occuring Events",IDC_STATIC,7,117,99,116
+ CONTROL "Incoming Message",IDC_EVENT_MESSAGE,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,15,131,85,10
+ CONTROL "Incoming URL",IDC_EVENT_URL,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,15,142,85,10
+ CONTROL "Incoming File",IDC_EVENT_FILE,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,15,153,85,10
+ CONTROL "Authorisation Request",IDC_EVENT_AUTHREQUEST,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,15,164,85,10
+ CONTROL "Added to Contact List",IDC_EVENT_ADDED,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,15,175,85,10
+ CONTROL "Ignore event if message dialog is focused",
+ IDC_DIALOG_FOCUSED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+ 120,153,181,10
+ GROUPBOX "Status Messages",IDC_STATIC,112,7,195,107
+ CONTROL "Announce status changes on connect",
+ IDC_SUPPRESS_CONNECT,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,120,19,181,10
+END
+
+IDD_ACTIVEMODES DIALOG DISCARDABLE 0, 0, 314, 240
+STYLE WS_CHILD
+FONT 8, "MS Sans Serif"
+BEGIN
+ GROUPBOX "Active Modes",IDC_STATIC,40,17,90,97
+ CONTROL "Online",IDC_ACTIVE_ONLINE,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,47,30,75,10
+ CONTROL "Away",IDC_ACTIVE_AWAY,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,47,41,75,10
+ CONTROL "Do not Disturb",IDC_ACTIVE_DND,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,47,52,75,10
+ CONTROL "Not Available",IDC_ACTIVE_NA,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,47,63,75,10
+ CONTROL "Occupied",IDC_ACTIVE_OCCUPIED,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,47,74,75,10
+ CONTROL "Free for Chat",IDC_ACTIVE_FREEFORCHAT,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,47,85,75,10
+ CONTROL "Invisible",IDC_ACTIVE_INVISIBLE,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,47,97,75,10
+ GROUPBOX "Active Users",IDC_STATIC,137,17,131,204
+ PUSHBUTTON "All",IDC_ACTIVE_ALL,145,200,35,14
+ PUSHBUTTON "None",IDC_ACTIVE_NONE,187,200,35,14
+ CONTROL "List1",IDC_ACTIVE_USERS,"SysListView32",LVS_SMALLICON |
+ LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,145,29,114,
+ 166
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE
+BEGIN
+ IDD_CONFIG, DIALOG
+ BEGIN
+ LEFTMARGIN, 5
+ RIGHTMARGIN, 306
+ TOPMARGIN, 4
+ BOTTOMMARGIN, 233
+ END
+
+ IDD_ANNOUNCE, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 307
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 233
+ END
+
+ IDD_ACTIVEMODES, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 307
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 233
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 0,9,7,0
+ PRODUCTVERSION 0,0,0,0
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "0c0904b0"
+ BEGIN
+ VALUE "Comments", "\0"
+ VALUE "CompanyName", "\0"
+ VALUE "FileDescription", "Speak plugin for Miranda ICQ\0"
+ VALUE "FileVersion", "0, 9, 7, 0\0"
+ VALUE "InternalName", "speak\0"
+ VALUE "LegalCopyright", "Copyright © 2002 Ryan Winter\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "speak.dll\0"
+ VALUE "PrivateBuild", "\0"
+ VALUE "ProductName", "\0"
+ VALUE "ProductVersion", "0, 0, 0, 0\0"
+ VALUE "SpecialBuild", "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0xc09, 1200
+ END
+END
+
+#endif // !_MAC
+
+#endif // English (Australia) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/unchecked.ico b/plugins/!NotAdopted/WinterSpeak/speak/unchecked.ico
new file mode 100644
index 0000000000..ff31e16b6a
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/unchecked.ico
Binary files differ
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/user/user_information.cpp b/plugins/!NotAdopted/WinterSpeak/speak/user/user_information.cpp
new file mode 100644
index 0000000000..0a2317f78c
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/user/user_information.cpp
@@ -0,0 +1,116 @@
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#pragma warning(disable:4786)
+
+#include "user_information.h"
+
+#include "speak.h"
+
+#include <general/debug/debug.h>
+
+//------------------------------------------------------------------------------
+// public:
+//------------------------------------------------------------------------------
+UserInformation::UserInformation()
+ :
+ m_status_info(),
+ m_status_strings()
+{
+ CLASSCERR("UserInformation::UserInformation");
+
+ // insert the status strings into a map for easy access
+ m_status_strings[ID_STATUS_OFFLINE] = "%u is now offline";
+ m_status_strings[ID_STATUS_ONLINE] = "%u is now online";
+ m_status_strings[ID_STATUS_AWAY] = "%u is away";
+ m_status_strings[ID_STATUS_INVISIBLE] = "%u is invisible";
+ m_status_strings[ID_STATUS_NA] = "%u is not available";
+ m_status_strings[ID_STATUS_DND] = "%u does not want to be disturbed";
+ m_status_strings[ID_STATUS_OCCUPIED] = "%u is occupied";
+ m_status_strings[ID_STATUS_FREECHAT] = "%u is free for chat";
+}
+
+//------------------------------------------------------------------------------
+UserInformation::~UserInformation()
+{
+ CLASSCERR("UserInformation::~UserInformation");
+}
+
+//------------------------------------------------------------------------------
+bool
+UserInformation::updateStatus(HANDLE user, int status)
+{
+ CLASSCERR("UserInformation::updateStatus(," << status << ")");
+
+ bool ret = false;
+
+ // if the user exists and their status hasn't changed, then return false
+ if ((m_status_info.find(user) != m_status_info.end())
+ && (m_status_info[user] != status))
+ {
+ ret = true;
+ }
+
+ // update the status
+ m_status_info[user] = status;
+
+ return ret;
+}
+
+//------------------------------------------------------------------------------
+std::string
+UserInformation::statusString(HANDLE user)
+{
+ CLASSCERR("UserInformation::statusString()");
+
+ return m_status_strings[m_status_info[user]];
+}
+
+//------------------------------------------------------------------------------
+std::string
+UserInformation::statusModeString(HANDLE user)
+{
+ CLASSCERR("UserInformation::statusModeString()");
+
+ int status = CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,
+ m_status_info[user], 0);
+
+ if (NULL == status)
+ {
+ return "";
+ }
+
+ return reinterpret_cast<char *>(status);
+}
+
+//------------------------------------------------------------------------------
+void
+UserInformation::insertName(std::string &str, HANDLE user) const
+{
+ CLASSCERR("UserInformation::insertName(" << str << ",)");
+
+ // insert the user's name into the string
+ str.replace(str.find("%u"), 2, nameString(user));
+}
+
+//------------------------------------------------------------------------------
+std::string
+UserInformation::nameString(HANDLE user) const
+{
+ CLASSCERR("UserInformation::nameString()");
+
+ char *ret = reinterpret_cast<char *>(
+ CallService(MS_CLIST_GETCONTACTDISPLAYNAME,
+ reinterpret_cast<unsigned int>(user),
+ 0));
+
+ if (0 == ret)
+ {
+ return "";
+ }
+
+ return Translate(ret);
+}
+
+//==============================================================================
diff --git a/plugins/!NotAdopted/WinterSpeak/speak/user/user_information.h b/plugins/!NotAdopted/WinterSpeak/speak/user/user_information.h
new file mode 100644
index 0000000000..5e6ec80d46
--- /dev/null
+++ b/plugins/!NotAdopted/WinterSpeak/speak/user/user_information.h
@@ -0,0 +1,69 @@
+#ifndef guard_speak_user_user_information_h
+#define guard_speak_user_user_information_h
+//==============================================================================
+// Miranda Speak Plugin, © 2002 Ryan Winter
+//==============================================================================
+
+#include <windows.h>
+
+#include <map>
+#include <string>
+
+class UserInformation
+{
+ public:
+ UserInformation();
+ ~UserInformation();
+
+ //--------------------------------------------------------------------------
+ // Description : update the users status
+ // Parameters : user - the current user
+ // status - the users status
+ // Returns : true - the status changed
+ // false - the status stayed the same
+ //--------------------------------------------------------------------------
+ bool updateStatus(HANDLE user, int status);
+
+ //--------------------------------------------------------------------------
+ // Description : get a string containing the users current status string
+ // Parameters : user - the current user
+ // Returns : the string containing the users status
+ //--------------------------------------------------------------------------
+ std::string statusString(HANDLE user);
+
+ //--------------------------------------------------------------------------
+ // Description : return the status mode of the user
+ // Parameters : user - the current user
+ // Returns : the string containing the users status mode
+ //--------------------------------------------------------------------------
+ std::string statusModeString(HANDLE user);
+
+ //--------------------------------------------------------------------------
+ // Description : insert the name into the string at the %u location
+ // Parameters : str - the string to have the username inserted into
+ // user - the current user
+ //--------------------------------------------------------------------------
+ void insertName(std::string &str, HANDLE user) const;
+
+ //--------------------------------------------------------------------------
+ // Description : get the name string for the user
+ // Parameters : user - the current user
+ // Returns : a string containing the user's name
+ //--------------------------------------------------------------------------
+ std::string nameString(HANDLE user) const;
+
+ private:
+ std::map<HANDLE, int> m_status_info;
+ std::map<int, std::string> m_status_strings;
+};
+
+//==============================================================================
+//
+// Summary : Contain information about the current users
+//
+// Description : Provides an interface to get various information about the
+// user. Also holds the users current status.
+//
+//==============================================================================
+
+#endif \ No newline at end of file