59 lines
1.3 KiB
C++
Executable File
59 lines
1.3 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* ActiveExerciseWithRadioGroup
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Christian Fröbel, NLSE, 2018-02-16
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <QObject>
|
|
#include <vector>
|
|
|
|
|
|
namespace AudioVideoManagement
|
|
{
|
|
|
|
class ExercisesHandler;
|
|
class ExerciseContext;
|
|
|
|
/**
|
|
* The ExercisesHandler emits a signal whenever an Exercise gets activated (or deactivated).
|
|
* (See there for what "activated" means).
|
|
*
|
|
* @see TvcHandler
|
|
* @see CnrHandler
|
|
* @see ExercisesHandler
|
|
* @author Christian Fröbel
|
|
*/
|
|
class ActiveExercises : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit ActiveExercises(ExercisesHandler *exercisesHandler);
|
|
~ActiveExercises() override;
|
|
|
|
/** Return all active Contexts. */
|
|
const std::vector<ExerciseContext> &allContexts() const;
|
|
int count() const { return m_activeExercises.size(); }
|
|
|
|
bool isActive(const ExerciseContext &context) const;
|
|
|
|
signals:
|
|
/** Signalled when the Exercise is active. */
|
|
void contextActivated(const ExerciseContext &context);
|
|
void contextDeactivated(const ExerciseContext &context);
|
|
|
|
private slots:
|
|
void onContextActivated(const ExerciseContext &context);
|
|
void onContextDeactivated(const ExerciseContext &context);
|
|
|
|
private:
|
|
std::vector<ExerciseContext> m_activeExercises;
|
|
};
|
|
|
|
} // namespace AudioVideoManagement
|