X-Git-Url: http://git.maemo.org/git/?p=mafwsubrenderer;a=blobdiff_plain;f=qmafw-gst-subtitles-renderer%2Finc%2FMafwGstRendererHaltState.h;fp=qmafw-gst-subtitles-renderer%2Finc%2FMafwGstRendererHaltState.h;h=d7168d1c8328ab0fcb601c0dc203a1542a5a098a;hp=0000000000000000000000000000000000000000;hb=226d35244df85a27c332d3a3ded1b25b3c7f4951;hpb=57ba96e291a055f69dbfd4ae9f1ae2390e36986e diff --git a/qmafw-gst-subtitles-renderer/inc/MafwGstRendererHaltState.h b/qmafw-gst-subtitles-renderer/inc/MafwGstRendererHaltState.h new file mode 100644 index 0000000..d7168d1 --- /dev/null +++ b/qmafw-gst-subtitles-renderer/inc/MafwGstRendererHaltState.h @@ -0,0 +1,83 @@ +/* + * This file is part of QMAFW + * + * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). All rights + * reserved. + * + * Contact: Visa Smolander + * + * This software, including documentation, is protected by copyright controlled + * by Nokia Corporation. All rights are reserved. Copying, including + * reproducing, storing, adapting or translating, any or all of this material + * requires the prior written consent of Nokia Corporation. This material also + * contains confidential information which may not be disclosed to others + * without the prior written consent of Nokia. + * + */ + +#ifndef MAFWGSTRENDERERHALTSTATE_H +#define MAFWGSTRENDERERHALTSTATE_H + +#include + +#include + +class MafwGstRendererHaltState : public QObject +{ + Q_OBJECT +public: + static int DECAY_TIME; +public: + MafwGstRendererHaltState(); + MafwGstRendererHaltState(const QString &uri, MafwRenderer::State state, int position); + ~MafwGstRendererHaltState(); + + /** + * Assigns other halt state to this object, also resets the decay timer. + */ + MafwGstRendererHaltState(const MafwGstRendererHaltState &other); + + /** + * Assigns other halt state to this object, also resets the decay timer. + */ + MafwGstRendererHaltState& operator =(const MafwGstRendererHaltState &other); + + + /** + * Set new renderer state for halt state, user pressed pause etc + * @param newState, if newState is MafwRenderer::Paused the decay time is paused also + */ + void setState(MafwRenderer::State newState); + + /** + * Is the halt state valid? Not decayed and contains relevenat information + */ + bool isSet() const; + + /** + * Clears the halt state from any valid content, also stop the decay timer + */ + void clear(); + + QString uri() const; + MafwRenderer::State state() const; + int position() const; + +Q_SIGNALS: + /** + * This signal is emitted when the MafwGstRendererHaltState::DECAY_TIME has passed + * from object creation or when valid parameters were assigned to it. + */ + void decayed(); + +private: + void initializeDecayTimer(); + +private: + QString m_uri; + MafwRenderer::State m_state; + int m_position; + QTimer m_decayTimer; +}; + +#endif // MAFWGSTRENDERERHALTSTATE_H