123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- #pragma once
- #ifndef __SpoutControls__
- #define __SpoutControls__
- #include <Shlobj.h>
- #include <Knownfolders.h>
- #include <comutil.h>
- #include <direct.h>
- #include <io.h>
- #include "spoutSDK.h"
- #pragma comment(lib, "comsuppw")
- struct filecontrol {
- string name;
- string desc;
-
-
-
-
-
-
-
-
- int fftype;
- float def;
- float value;
- float min;
- float max;
- string text;
-
- };
- struct control {
- string name;
- int type;
- float value;
- string text;
- };
- class SPOUT_DLLEXP SpoutControls {
- public:
- SpoutControls();
- ~SpoutControls();
-
- bool FindControls (string &mapname);
- bool CreateControls(string mapname, vector<control> controls);
- bool SetControls (vector<control> controls);
- bool Cleanup();
- void CloseMap();
- bool FindControlFile (string &filepath);
- bool CopyControlFile (string &filepath, string &destpath);
-
- bool CreateControl(string name, string type);
- bool CreateControl(string name, string type, float value);
- bool CreateControl(string name, string type, string text);
- bool CreateControl(string name, string type, float minimum, float maximum, float value);
- bool OpenControls (string mapname);
- bool GetControls (vector<control> &controls);
- bool CheckControls(vector<control> &controls);
- bool CloseControls();
- bool OpenSpoutController(string CommandLine = "");
-
- bool WritePathToRegistry (const char *filepath, const char *subkey, const char *valuename);
- bool ReadPathFromRegistry (char *filepath, const char *subkey, const char *valuename);
- bool WriteDwordToRegistry (DWORD dwValue, const char *subkey, const char *valuename);
- bool ReadDwordFromRegistry (DWORD *pValue, const char *subkey, const char *valuename);
- bool RemovePathFromRegistry(char *filepath, const char *subkey);
- protected :
- string m_sharedMemoryName;
- HANDLE m_hSharedMemory;
- LPTSTR m_pBuffer;
- HANDLE m_hAccessMutex;
- HANDLE m_hSlot;
- DWORD m_dwSize;
- char m_ControlFilePath[MAX_PATH];
- vector<filecontrol> filecontrols;
- bool UpdateControls(vector<control> controls);
- bool WriteControls(void *pBuffer, vector<control> controls);
- bool ReadControls (void *pBuffer, vector<control> &controls);
- bool CreateMail(string slotname, HANDLE &hSlot);
- bool WriteMail (string SlotName, string SlotMessage);
- bool ReadMail (string SlotName, HANDLE hSlot, string &SlotMessage);
- bool CheckMail (string SlotName, HANDLE hSlot);
- bool CreateFileControl(string name, string type, float minimum, float maximum, float value, string text);
- bool CreateControlFile(const char *filepath);
- };
- #endif
|