projects
/
mouse-tracker-for-cubism.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add command-line interface to control model
[mouse-tracker-for-cubism.git]
/
include
/
mouse_cursor_tracker.h
diff --git
a/include/mouse_cursor_tracker.h
b/include/mouse_cursor_tracker.h
index
a53713f
..
6cd91c4
100644
(file)
--- a/
include/mouse_cursor_tracker.h
+++ b/
include/mouse_cursor_tracker.h
@@
-26,8
+26,11
@@
SOFTWARE.
****/
#include <string>
****/
#include <string>
-#include <map>
#include <thread>
#include <thread>
+#include <vector>
+#include <utility>
+#include <mutex>
+#include <map>
extern "C"
{
#include <xdo.h>
extern "C"
{
#include <xdo.h>
@@
-37,28
+40,38
@@
extern "C"
class MouseCursorTracker
{
public:
class MouseCursorTracker
{
public:
- MouseCursorTracker(std::string cfgPath);
+ MouseCursorTracker(std::string cfgPath,
+ std::vector<std::pair<std::string, int> > motions = {},
+ std::vector<std::string> expressions = {});
~MouseCursorTracker();
~MouseCursorTracker();
+ enum class MotionPriority
+ {
+ // See LAppDefine.cpp in Demo
+ none,
+ idle,
+ normal,
+ force
+ };
+
struct Params
{
struct Params
{
- double leftEyeOpenness;
- double rightEyeOpenness;
- double leftEyeSmile;
- double rightEyeSmile;
- double mouthOpenness;
- double mouthForm;
- double faceXAngle;
- double faceYAngle;
- double faceZAngle;
+ std::map<std::string, double> live2d;
+
bool autoBlink;
bool autoBreath;
bool autoBlink;
bool autoBreath;
- bool randomMotion;
+ bool random
Idle
Motion;
bool useLipSync;
double lipSyncParam;
bool useLipSync;
double lipSyncParam;
+
+ MotionPriority motionPriority;
+ std::string motionGroup;
+ int motionNumber;
+
+ std::string expression;
};
};
- Params getParams(void)
const
;
+ Params getParams(void);
void stop(void);
void stop(void);
@@
-76,7
+89,7
@@
private:
int sleepMs;
bool autoBlink;
bool autoBreath;
int sleepMs;
bool autoBlink;
bool autoBreath;
- bool randomMotion;
+ bool random
Idle
Motion;
bool useLipSync;
double lipSyncGain;
double lipSyncCutOff;
bool useLipSync;
double lipSyncGain;
double lipSyncCutOff;
@@
-87,9
+100,11
@@
private:
int left;
int right;
int screen;
int left;
int right;
int screen;
- Coord
middle
;
+ Coord
origin
;
} m_cfg;
} m_cfg;
+ std::map<std::string, double> m_overrideMap;
+
bool m_stop;
Coord m_curPos;
bool m_stop;
Coord m_curPos;
@@
-97,10
+112,19
@@
private:
xdo_t *m_xdo;
std::thread m_getVolumeThread;
xdo_t *m_xdo;
std::thread m_getVolumeThread;
+ std::thread m_parseCommandThread;
void audioLoop(void);
void audioLoop(void);
+ void cliLoop(void);
+ void processCommand(std::string);
double m_currentVol;
pa_simple *m_pulse;
double m_currentVol;
pa_simple *m_pulse;
+ MotionPriority m_motionPriority;
+ std::string m_motionGroup;
+ int m_motionNumber;
+ std::mutex m_motionMutex;
+ std::string m_expression;
+
void populateDefaultConfig(void);
void parseConfig(std::string cfgPath);
};
void populateDefaultConfig(void);
void parseConfig(std::string cfgPath);
};