1
- #include " ReplayManager .h"
1
+ #include " ReplayRecorder .h"
2
2
#include " Hearthstone.h"
3
3
4
4
#include < QDir>
9
9
#define REPLAY_BITRATE 500
10
10
#define REPLAY_FPS 1
11
11
12
- ReplayManager::ReplayManager ( HearthstoneLogTracker *logTracker )
12
+ ReplayRecorder::ReplayRecorder ( HearthstoneLogTracker *logTracker )
13
13
: mSpectating( false ),
14
14
mWriter(
15
15
REPLAY_WIDTH, REPLAY_HEIGHT,
@@ -25,13 +25,13 @@ ReplayManager::ReplayManager( HearthstoneLogTracker *logTracker )
25
25
connect ( WebProfile::Instance (), SIGNAL ( UploadResultSucceeded (const QJsonObject&) ), this , SLOT ( UploadResultSucceeded (const QJsonObject&) ) );
26
26
}
27
27
28
- ReplayManager ::~ReplayManager () {
28
+ ReplayRecorder ::~ReplayRecorder () {
29
29
if ( mWriter .IsOpen () ) {
30
30
mWriter .Close ();
31
31
}
32
32
}
33
33
34
- void ReplayManager ::HandleMatchStart () {
34
+ void ReplayRecorder ::HandleMatchStart () {
35
35
if ( mWriter .IsOpen () ) {
36
36
mWriter .Close ();
37
37
}
@@ -42,7 +42,7 @@ void ReplayManager::HandleMatchStart() {
42
42
}
43
43
}
44
44
45
- void ReplayManager ::HandleTurn ( int turnCounter ) {
45
+ void ReplayRecorder ::HandleTurn ( int turnCounter ) {
46
46
UNUSED_ARG ( turnCounter );
47
47
48
48
if ( !mSpectating ) {
@@ -58,11 +58,11 @@ void ReplayManager::HandleTurn( int turnCounter ) {
58
58
}
59
59
}
60
60
61
- void ReplayManager ::HandleSpectating ( bool nowSpectating ) {
61
+ void ReplayRecorder ::HandleSpectating ( bool nowSpectating ) {
62
62
mSpectating = nowSpectating;
63
63
}
64
64
65
- void ReplayManager ::UploadResultSucceeded ( const QJsonObject& response ) {
65
+ void ReplayRecorder ::UploadResultSucceeded ( const QJsonObject& response ) {
66
66
int id = response[ " result" ].toObject ()[ " id" ].toInt ();
67
67
if ( !id ) {
68
68
ERR ( " Invalid ID received. Cannot save replays" );
@@ -78,11 +78,11 @@ void ReplayManager::UploadResultSucceeded( const QJsonObject& response ) {
78
78
}
79
79
}
80
80
81
- QString ReplayManager ::AppFolder () {
81
+ QString ReplayRecorder ::AppFolder () {
82
82
return AppFolder (" " );
83
83
}
84
84
85
- QString ReplayManager ::AppFolder ( const QString& fileName ) {
85
+ QString ReplayRecorder ::AppFolder ( const QString& fileName ) {
86
86
QString path = RetrieveDropboxPath () + " /Apps/Track-o-Bot/" ;
87
87
if ( !QDir ( path ).exists () ) {
88
88
return QString ();
@@ -91,7 +91,7 @@ QString ReplayManager::AppFolder( const QString& fileName ) {
91
91
return path + fileName;
92
92
}
93
93
94
- QString ReplayManager ::RetrieveDropboxPath () {
94
+ QString ReplayRecorder ::RetrieveDropboxPath () {
95
95
#ifdef Q_OS_MAC
96
96
QString path = QDir::homePath () + " /.dropbox/host.db" ;
97
97
#else
@@ -120,6 +120,6 @@ QString ReplayManager::RetrieveDropboxPath() {
120
120
return QByteArray::fromBase64 ( bytes );
121
121
}
122
122
123
- bool ReplayManager ::CanRecordReplays () {
123
+ bool ReplayRecorder ::CanRecordReplays () {
124
124
return !AppFolder ().isEmpty ();
125
125
}
0 commit comments