test ist now working
[profile/ivi/genivi/genivi-audio-manager.git] / exampleCode / player / audiomanagerinteractor.h
1 /**
2  * Copyright (C) 2012, BMW AG
3  *
4  *
5  * \copyright
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation, version 2
9  * of the License.
10
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19  *
20  *
21  * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
22  *
23  *
24  */
25
26
27 #ifndef AUDIOMANAGERINTERACTOR_H
28 #define AUDIOMANAGERINTERACTOR_H
29
30 #include <dbus/dbus.h>
31 #include <glib.h>
32 #include <stdint.h>
33 #include <dbus/dbus-glib.h>
34 #include <dbus/dbus-glib-lowlevel.h>
35 #include <QtGui/QWidget>
36 #include <QtGui/QApplication>
37 #include <QtCore/QTimerEvent>
38 #include <QtGui/QShowEvent>
39 #include <QtGui/QIcon>
40 #include <QtCore/QBasicTimer>
41 #include <QtGui/QAction>
42 #include <QObject>
43 #include <phonon/phononnamespace.h>
44 #include "dbushandler.h"
45
46 class AudioManagerInteractor : public QObject
47 {
48     Q_OBJECT
49 public:
50     AudioManagerInteractor(DbusHandler* DbusHandler, am_sourceID_t sourceID, am_sinkID_t sinkID);
51     ~AudioManagerInteractor();
52
53 signals:
54     void play();
55     void stop();
56
57 public slots:
58     void playPause();
59     void SourceActivity(am_sourceID_t source,am_SourceState_e state);
60     void getPlayerState(Phonon::State newstate);
61 private:
62     DbusHandler* mDbusHandler;
63     am_sourceID_t mSourceID;
64     am_sinkID_t mSinkID;
65     am_connectionID_t mConnectionID;
66     Phonon::State mState;
67     enum connected_e
68     {
69         CONNECTED,
70         CONNECTING,
71         DISCONNECTED
72     };
73     connected_e mConnectedState;
74 };
75
76 #endif // AUDIOMANAGERINTERACTOR_H