diff options
Diffstat (limited to 'AudioManagerDaemon/AudioManagerCore.h')
-rw-r--r-- | AudioManagerDaemon/AudioManagerCore.h | 110 |
1 files changed, 54 insertions, 56 deletions
diff --git a/AudioManagerDaemon/AudioManagerCore.h b/AudioManagerDaemon/AudioManagerCore.h index 1f9be8d..9342ef2 100644 --- a/AudioManagerDaemon/AudioManagerCore.h +++ b/AudioManagerDaemon/AudioManagerCore.h @@ -26,7 +26,6 @@ #ifndef AUDIOMANAGERCORE_H_ #define AUDIOMANAGERCORE_H_ -#include <QtCore/QObject> #include "audioManagerIncludes.h" @@ -57,15 +56,13 @@ class DBusCommandInterface; * \fn void Task::signal_nextTask() * \brief by emitting this signal, the next task in the queue is triggered */ -class Task: public QObject { -Q_OBJECT +class Task { public: Task(); Task(AudioManagerCore* core); virtual ~Task(); virtual void executeTask(Queue* queue)=0; -signals: void signal_nextTask(); protected: AudioManagerCore* m_core; //!< pointer to the core @@ -102,7 +99,7 @@ protected: * \brief used to handle the timeout */ class TaskAsyncConnect: public Task { -Q_OBJECT + public: TaskAsyncConnect(AudioManagerCore* core, sink_t sink, source_t source); virtual ~TaskAsyncConnect(); @@ -112,14 +109,16 @@ public: source_t getSource(); void executeTask(Queue* queue); -public slots: void slot_connect_finished(genHandle_t handle, genError_t error); void slot_timeout(); private: sink_t m_ParamSink; //!< the sink to be connected source_t m_ParamSource; //!< the source to be connected genHandle_t m_handle; //!< the handle (ConnectionID) - QTimer* m_timer; //!< pointer to a timer used for timeout tracking + //QTimer* m_timer; //!< pointer to a timer used for timeout tracking + /** + * \todo implement non QT Timer + */ }; /** @@ -134,7 +133,7 @@ private: * */ class TaskConnect: public Task { -Q_OBJECT + public: TaskConnect(AudioManagerCore* core, sink_t sink, source_t source); virtual ~TaskConnect(); @@ -156,7 +155,7 @@ private: * */ class TaskDisconnect: public Task { -Q_OBJECT + public: TaskDisconnect(AudioManagerCore* core, connection_t ID); virtual ~TaskDisconnect(); @@ -179,12 +178,12 @@ private: * \param ID the interrupt ID of the interrupt that resumed */ class TaskInterruptWait: public Task { -Q_OBJECT + public: TaskInterruptWait(AudioManagerCore* core, genInt_t connectionID); virtual ~TaskInterruptWait(); void executeTask(Queue* queue); -public slots: + void slot_interrupt_ready(genInt_t ID); private: genInt_t m_interruptID; //!< the interrupt ID that should be waited for @@ -213,7 +212,7 @@ private: * \brief returns the volume */ class TaskSetVolume: public Task { -Q_OBJECT + public: TaskSetVolume(AudioManagerCore* core, volume_t newVolume=0, sink_t sink=0); virtual ~TaskSetVolume(); @@ -250,7 +249,7 @@ private: * \brief returns the volume */ class TaskSetSourceVolume: public Task { -Q_OBJECT + public: TaskSetSourceVolume(AudioManagerCore* core, volume_t newVolume=0, source_t source=0); virtual ~TaskSetSourceVolume(); @@ -286,19 +285,20 @@ private: * \brief slot called when the time is up */ class TaskWait: public Task { -Q_OBJECT + public: TaskWait(AudioManagerCore* core, int mseconds); virtual ~TaskWait(); void setTime(int mseconds); int getTime(); void executeTask(Queue* queue); - -public slots: void slot_timeIsup(); private: int m_ParamMSeconds;//!< time to be delayed in milli seconds - QTimer* m_timer; //!< pointer to timer +// QTimer* m_timer; //!< pointer to timer + /** + *\todo replace Qtimer + */ }; /** @@ -310,7 +310,7 @@ private: * \brief enters a user connect into the database */ class TaskEnterUserConnect: public Task { -Q_OBJECT + public: TaskEnterUserConnect(AudioManagerCore* core, genRoute_t route, connection_t connID=0); virtual ~TaskEnterUserConnect(); @@ -330,7 +330,7 @@ private: * \brief constructor */ class TaskRemoveUserConnect : public Task { -Q_OBJECT + public: TaskRemoveUserConnect(AudioManagerCore* core, connection_t connID); virtual ~TaskRemoveUserConnect(); @@ -346,16 +346,16 @@ private: * \brief enters an interrupt into the database */ class TaskEnterInterrupt: public Task { -Q_OBJECT + public: - TaskEnterInterrupt(AudioManagerCore* core, genInt_t ID,bool mixed, connection_t connID, QList<source_t> listInterruptedSources); + TaskEnterInterrupt(AudioManagerCore* core, genInt_t ID,bool mixed, connection_t connID, std::list<source_t> listInterruptedSources); virtual ~TaskEnterInterrupt(); void executeTask(Queue* queue); private: genInt_t m_intID; //!< the interrupt ID bool m_mixed; //!< true if mixed connection_t m_connectionID; //!< the connection ID - QList<source_t> m_interruptedSourcesList; //!< the list of interrupted sources + std::list<source_t> m_interruptedSourcesList; //!< the list of interrupted sources }; /** @@ -363,7 +363,7 @@ private: * \brief removes an interrupt */ class TaskRemoveInterrupt: public Task { -Q_OBJECT + public: TaskRemoveInterrupt(AudioManagerCore* core, genInt_t ID); virtual ~TaskRemoveInterrupt(); @@ -377,7 +377,7 @@ private: * \brief mutes a source */ class TaskSetSourceMute: public Task { -Q_OBJECT + public: TaskSetSourceMute(AudioManagerCore* core, source_t source); virtual ~TaskSetSourceMute(); @@ -391,7 +391,7 @@ private: * \brief unmutes a source */ class TaskSetSourceUnmute: public Task { -Q_OBJECT + public: TaskSetSourceUnmute(AudioManagerCore* core, source_t source); virtual ~TaskSetSourceUnmute(); @@ -405,7 +405,6 @@ private: * \brief emits the signal connect */ class TaskEmitSignalConnect: public Task { -Q_OBJECT public: TaskEmitSignalConnect(AudioManagerCore* core); virtual ~TaskEmitSignalConnect(); @@ -420,7 +419,7 @@ public: * \todo sorting of tasks * \todo add some function to attach parameters to the Queue so that organizing and handling is possible * - * \fn Queue::Queue(AudioManagerCore* core,QString name="") + * \fn Queue::Queue(AudioManagerCore* core,std::string name="") * \brief constructor * \param name give the queue a name * \param core pointer to AudioManagerCore @@ -437,38 +436,38 @@ public: * \param task pointer to the task * \return GEN_OK on success * - * \fn QList<Task*> Queue::getTaskList() + * \fn std::list<Task*> Queue::getTaskList() * \brief returns the actual task list * \return list with pointers to the tasks * - * \fn QString Queue::returnName() + * \fn std::string Queue::returnName() * \brief returns the name of the Queue - * \return the name in QString format + * \return the name in std::string format * * \fn void Queue::slot_nextTask() * \brief is called when a task is finished and the next task can be called */ -class Queue: public QObject { -Q_OBJECT +class Queue{ + public: - Queue(AudioManagerCore* core,QString name=""); + Queue(AudioManagerCore* core,std::string name=""); virtual ~Queue(); void run(); void addTask(Task* task); genError_t removeTask(Task* task); - QList<Task*> getTaskList(); - QString returnName(); + std::list<Task*> getTaskList(); + std::string returnName(); -public slots: void slot_nextTask(); private: AudioManagerCore* m_core; //!< pointer to AudioManagerCore - int m_currentIndex; //!< the index of the list wich is currently worked on - QString m_name; //!< name of the Queue - QList<Task*> m_taskList; //!< the list with pointers to the tasks + std::list<Task*>::iterator m_currentIndex; //!< the index of the list wich is currently worked on + std::string m_name; //!< name of the Queue + std::list<Task*> m_taskList; //!< the list with pointers to the tasks }; -/** +/**:3: error: ISO C++ forbids declaration of ‘type name’ with no type + * * \class AudioManagerCore * \brief The central Managing Class of the AudioManager * @@ -502,25 +501,25 @@ private: * \fn genError_t AudioManagerCore::setSourceUnMute (source_t source) * \brief unmutes a source * - * \fn genError_t AudioManagerCore::getRoute(const bool onlyfree, const source_t source, const sink_t sink, QList<genRoute_t>* ReturnList) + * \fn genError_t AudioManagerCore::getRoute(const bool onlyfree, const source_t source, const sink_t sink, std::list<genRoute_t>* ReturnList) * \brief returns a route * * \fn connection_t AudioManagerCore::returnConnectionIDforSinkSource (sink_t sink, source_t source) * \brief returns the connection ID for a sink source combination * - * \fn source_t AudioManagerCore::returnSourceIDfromName(const QString name) + * \fn source_t AudioManagerCore::returnSourceIDfromName(const std::string name) * \brief returns the source ID for a name * - * \fn sink_t AudioManagerCore::returnSinkIDfromName(const QString name) + * \fn sink_t AudioManagerCore::returnSinkIDfromName(const std::string name) * \brief returns the sink ID for a given name * - * \fn QList<ConnectionType> AudioManagerCore::getListConnections() + * \fn std::list<ConnectionType> AudioManagerCore::getListConnections() * \brief returns the list of connections * - * \fn QList<SinkType> AudioManagerCore::getListSinks() + * \fn std::list<SinkType> AudioManagerCore::getListSinks() * \brief returns a list of all sinks * - * \fn QList<SourceType> AudioManagerCore::getListSources() + * \fn std::list<SourceType> AudioManagerCore::getListSources() * \brief returns a list of all sources * * \fn void AudioManagerCore::emitSignalConnect() @@ -564,8 +563,8 @@ private: * * */ -class AudioManagerCore :public QObject { -Q_OBJECT +class AudioManagerCore { + public: AudioManagerCore(); virtual ~AudioManagerCore(); @@ -581,14 +580,14 @@ public: genError_t setSourceMute (source_t source); genError_t setSourceUnMute (source_t source); - genError_t getRoute(const bool onlyfree, const source_t source, const sink_t sink, QList<genRoute_t>* ReturnList); + genError_t getRoute(const bool onlyfree, const source_t source, const sink_t sink, std::list<genRoute_t>* ReturnList); connection_t returnConnectionIDforSinkSource (sink_t sink, source_t source); - source_t returnSourceIDfromName(const QString name); - sink_t returnSinkIDfromName(const QString name); + source_t returnSourceIDfromName(const std::string name); + sink_t returnSinkIDfromName(const std::string name); - QList<ConnectionType> getListConnections(); - QList<SinkType> getListSinks(); - QList<SourceType> getListSources(); + std::list<ConnectionType> getListConnections(); + std::list<SinkType> getListSinks(); + std::list<SourceType> getListSources(); void emitSignalConnect(); @@ -607,7 +606,6 @@ public: void addQueue(Queue* queue); genError_t removeQueue(Queue* queue); -signals: void signal_connectionChanged(); void signal_numberOfSinksChanged(); void signal_numberOfSourcesChanged(); @@ -620,7 +618,7 @@ private: RoutingReceiver* m_receiver; //!< pointer to the Routing receiver Class DBusCommandInterface* m_command; //!< pointer to the command Interface Class - QList<Queue*> m_queueList; //!< List of pointers to all running queues + std::list<Queue*> m_queueList; //!< List of pointers to all running queues }; #endif /* AUDIOMANAGERCORE_H_ */ |