-
Notifications
You must be signed in to change notification settings - Fork 0
/
TcBtMusicConvertor.cpp
89 lines (84 loc) · 2.8 KB
/
TcBtMusicConvertor.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 "TcBtMusicConvertor.h"
#include "tcbtmusic_adaptor.h"
#include "TcBtMusic.h"
TcBtMusicConvertor* TcBtMusicConvertor::m_instance = nullptr;
TcBtMusicConvertor* TcBtMusicConvertor::getIntance()
{
if (!m_instance)
{
m_instance = new TcBtMusicConvertor();
}
return m_instance;
}
TcBtMusicConvertor::TcBtMusicConvertor() :
m_adaptor(new TcBtMusicAdaptor(this))
{
setProperty("interfaceClassName", "TcBtMusic");
connect(g_TcBtMusic, SIGNAL(btavSinkConnected()), SIGNAL(avSinkConnected()));
connect(g_TcBtMusic, SIGNAL(btavSinkDisConnected()), SIGNAL(avSinkDisConnected()));
connect(g_TcBtMusic, SIGNAL(btgetMetaDataAlbum(QString)), SIGNAL(getMetaDataAlbum(QString)));
connect(g_TcBtMusic, SIGNAL(btgetMetaDataArtist(QString)), SIGNAL(getMetaDataArtist(QString)));
connect(g_TcBtMusic, SIGNAL(btgetMetaDataGenre(QString)), SIGNAL(getMetaDataGenre(QString)));
connect(g_TcBtMusic, SIGNAL(btgetMetaDataTitle(QString)), SIGNAL(getMetaDataTitle(QString)));
connect(g_TcBtMusic, SIGNAL(btgetCurrentPostion(int)), SIGNAL(getCurrentPostion(int)));
connect(g_TcBtMusic, SIGNAL(btgetPlayStatus(int)), SIGNAL(getPlayStatus(int)));
connect(g_TcBtMusic, SIGNAL(btgetTotalLength(int)), SIGNAL(getTotalLength(int)));
connect(g_TcBtMusic, SIGNAL(btgetTotalTime(int)), SIGNAL(getTotalTime(int)));
connect(g_TcBtMusic, SIGNAL(btchangeRepeatMode(int)), SIGNAL(changeRepeatMode(int)));
connect(g_TcBtMusic, SIGNAL(btchangeShuffleMode(int)), SIGNAL(changeShuffleMode(int)));
}
TcBtMusicConvertor::~TcBtMusicConvertor()
{
}
void TcBtMusicConvertor::closeBtMusic()
{
g_TcBtMusic->closeBtMusic();
}
void TcBtMusicConvertor::openBtMusic()
{
g_TcBtMusic->openBtMusic();
}
void TcBtMusicConvertor::requeseBtMusicAudioSource()
{
g_TcBtMusic->requeseBtMusicAudioSource();
}
void TcBtMusicConvertor::playFF()
{
fprintf(stderr, "btapp service playFF\n");
g_TcBtMusic->cmdMusicFF();
}
void TcBtMusicConvertor::playNext()
{
fprintf(stderr, "btapp service playNext\n");
g_TcBtMusic->cmdMusicNext();
}
void TcBtMusicConvertor::playPre()
{
fprintf(stderr, "btapp service playPre\n");
g_TcBtMusic->cmdMusicPre();
}
void TcBtMusicConvertor::playRew()
{
fprintf(stderr, "btapp service playRew\n");
g_TcBtMusic->cmdMusicREW();
}
void TcBtMusicConvertor::playStart()
{
fprintf(stderr, "btapp service playStart\n");
g_TcBtMusic->cmdMusicStart();
}
void TcBtMusicConvertor::playStop()
{
fprintf(stderr, "btapp service playStop\n");
g_TcBtMusic->cmdMusicStop();
}
void TcBtMusicConvertor::SetRepeatMode(int mode)
{
fprintf(stderr, "btapp service SetRepeatMode\n");
g_TcBtMusic->cmdSetRepeatMode(mode);
}
void TcBtMusicConvertor::SetShuffleMode(int mode)
{
fprintf(stderr, "btapp service SetShuffleMod\n");
g_TcBtMusic->cmdSetShuffleMode(mode);
}