-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvoiceplayer.cpp
89 lines (78 loc) · 2.09 KB
/
voiceplayer.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include "voiceplayer.h"
#include "ui_voiceplayer.h"
#include "msgdef.h"
VoicePlayer::VoicePlayer(QWidget *parent) :
QWidget(parent),
ui(new Ui::VoicePlayer)
{
ui->setupUi(this);
}
VoicePlayer::~VoicePlayer()
{
delete ui;
}
void VoicePlayer::setMessage(const Message &msg)
{
// m_message = msg;
// for(int i=0; i<msg.items().count(); i++)
// {
// QString emotion;
// bool ok = false;
// int emotionIndex = 0;
// QString localFileName;
// QString imageFile;
// QFile file;
// auto item = msg.items().at(i);
// switch(item.type)
// {
// case BasicDef::MIT_VOICE:
// break;
// case BasicDef::MIT_IMAGE:
// localFileName = item.data;
// if(localFileName.contains("/"))
// {
// localFileName = localFileName.mid(localFileName.lastIndexOf("/") + 1);
// }
// imageFile = localFileName;//m_chatImagePath + "/" + localFileName;
// file.setFileName(imageFile);
// if(file.exists())
// {
// appendImage(QUrl::fromLocalFile(imageFile).toString());
// }
// break;
// case BasicDef::MIT_EMOTICONS:
// emotion = item.data;
// if (emotion.startsWith("face"))
// {
// emotion.remove("face");
// }
// emotionIndex = emotion.toInt(&ok);
// if (ok)
// {
// appendBaseFace(emotionIndex);
// }
// break;
// case BasicDef::MIT_GIF:
// emotion = item.data;
// if (emotion.startsWith("bface"))
// {
// emotion.remove("bface");
// }
// ok = false;
// emotionIndex = emotion.toInt(&ok);
// if (ok)
// {
// appendHuhooFace(emotionIndex);
// }
// break;
// default:
// break;
// }
// }
update();
updateGeometry();
}
Message VoicePlayer::message() const
{
return m_message;
}