summaryrefslogtreecommitdiff
path: root/AudioManagerDaemon/src/main.cpp
blob: 59682eb9a1ffb80ff0181961e47aeae277dc1620 (plain)
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
/*
 * main.cpp
 *
 *  Created on: Oct 24, 2011
 *      Author: christian
 */

//todo: add debug commandline option to allow to use other than memory database
//todo: make real daemon out of it- systemd conform

#include "control/ControlReceiveInterface.h"
#include "RoutingReceiver.h"
#include "CommandReceiver.h"
#include "ControlReceiver.h"
#include "DatabaseHandler.h"
#include "ControlSender.h"
#include "CommandSender.h"
#include "RoutingSender.h"
#include "DBusWrapper.h"
#include <dbus/dbus.h>
#include <dlt/dlt.h>

DLT_DECLARE_CONTEXT(AudioManager)

#define UNIT_TEST 1

using namespace am;

int main(int argc, char *argv[])
{
	DLT_REGISTER_APP("AudioManagerDeamon","AudioManagerDeamon");
	DLT_REGISTER_CONTEXT(AudioManager,"Main","Main Context");
	DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("The AudioManager is started "));

	DatabaseHandler iDatabaseHandler;
	DBusWrapper iDBusWrapper;
	RoutingSender iRoutingSender;
	CommandSender iCommandSender;
	ControlSender iControlSender;
	Observer iObserver(&iCommandSender, &iRoutingSender);
	CommandReceiver iCommandReceiver(&iDatabaseHandler,&iDBusWrapper,&iControlSender);
	RoutingReceiver iRoutingReceiver(&iDatabaseHandler,&iRoutingSender,&iControlSender);
	ControlReceiver iControlReceiver(&iDatabaseHandler, &iRoutingSender);

	iCommandSender.startupInterface(&iCommandReceiver);

	iDBusWrapper.dbusMainLoop();

}