1 #include "mainapplication.h"
5 MainApplication::MainApplication(QObject
*parent
) :
8 raopService
= new RaopService(0);
9 dnssdService
= new DnssdService(0);
10 trayIconMenu
= new QMenu(0);
12 // Initialize the service
13 raopService
->init(10, &m_callbacks
);
16 quitAction
= new QAction(tr("&Quit"), trayIconMenu
);
17 connect(quitAction
, SIGNAL(triggered()), this, SIGNAL(quitRequested()));
18 trayIconMenu
->addAction(quitAction
);
20 // Construct the actual system tray icon
21 trayIcon
= new QSystemTrayIcon(this);
22 trayIcon
->setContextMenu(trayIconMenu
);
23 trayIcon
->setIcon(QIcon(":icons/airtv.svg"));
26 MainApplication::~MainApplication()
28 trayIcon
->setContextMenu(0);
33 void MainApplication::start()
35 char chwaddr
[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB };
36 QByteArray
hwaddr(chwaddr
, sizeof(chwaddr
));
38 raopService
->start(5000, hwaddr
);
39 dnssdService
->registerRaop("Shairplay", 5000, hwaddr
);
43 void MainApplication::stop()
45 dnssdService
->unregisterRaop();
50 void MainApplication::aboutToQuit()