MythTV  0.26-pre
Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
PreviewGeneratorQueue Class Reference

#include <previewgeneratorqueue.h>

Inheritance diagram for PreviewGeneratorQueue:
MThread

List of all members.

Static Public Member Functions

static void CreatePreviewGeneratorQueue (PreviewGenerator::Mode mode, uint maxAttempts, uint minBlockSeconds)
static void TeardownPreviewGeneratorQueue ()
static void GetPreviewImage (const ProgramInfo &pginfo, QString token)
static void GetPreviewImage (const ProgramInfo &, const QSize &, const QString &outputfile, long long time, bool in_seconds, QString token)
static void AddListener (QObject *)
static void RemoveListener (QObject *)

Private Member Functions

 PreviewGeneratorQueue (PreviewGenerator::Mode mode, uint maxAttempts, uint minBlockSeconds)
 ~PreviewGeneratorQueue ()
QString GeneratePreviewImage (ProgramInfo &pginfo, const QSize &, const QString &outputfile, long long time, bool in_seconds, QString token)
void GetInfo (const QString &key, uint &queue_depth, uint &preview_tokens)
void SetPreviewGenerator (const QString &key, PreviewGenerator *g)
 Sets the PreviewGenerator for a specific file.
void IncPreviewGeneratorPriority (const QString &key, QString token)
void UpdatePreviewGeneratorThreads (void)
bool IsGeneratingPreview (const QString &key) const
 Returns true if we have already started a PreviewGenerator to create this file.
uint IncPreviewGeneratorAttempts (const QString &key)
 Increments and returns number of times we have started a PreviewGenerator to create this file.
void ClearPreviewGeneratorAttempts (const QString &key)
 Clears the number of times we have started a PreviewGenerator to create this file.
virtual bool event (QEvent *e)
void SendEvent (const ProgramInfo &pginfo, const QString &eventname, const QString &fn, const QString &token, const QString &msg, const QDateTime &dt)

Private Attributes

QSet< QObject * > m_listeners
QMutex m_lock
PreviewGenerator::Mode m_mode
PreviewMap m_previewMap
QMap< QString, QString > m_tokenToKeyMap
QStringList m_queue
uint m_running
uint m_maxThreads
uint m_maxAttempts
uint m_minBlockSeconds

Static Private Attributes

static PreviewGeneratorQueues_pgq = NULL

Detailed Description

Definition at line 33 of file previewgeneratorqueue.h.


Constructor & Destructor Documentation

PreviewGeneratorQueue::PreviewGeneratorQueue ( PreviewGenerator::Mode  mode,
uint  maxAttempts,
uint  minBlockSeconds 
) [private]

Definition at line 31 of file previewgeneratorqueue.cpp.

Referenced by CreatePreviewGeneratorQueue().

Definition at line 49 of file previewgeneratorqueue.cpp.


Member Function Documentation

void PreviewGeneratorQueue::CreatePreviewGeneratorQueue ( PreviewGenerator::Mode  mode,
uint  maxAttempts,
uint  minBlockSeconds 
) [static]

Definition at line 17 of file previewgeneratorqueue.cpp.

Referenced by main(), and MainServer::MainServer().

Definition at line 24 of file previewgeneratorqueue.cpp.

Referenced by main(), and MainServer::Stop().

static void PreviewGeneratorQueue::GetPreviewImage ( const ProgramInfo pginfo,
QString  token 
) [inline, static]
void PreviewGeneratorQueue::GetPreviewImage ( const ProgramInfo pginfo,
const QSize &  outputsize,
const QString &  outputfile,
long long  time,
bool  in_seconds,
QString  token 
) [static]

Definition at line 63 of file previewgeneratorqueue.cpp.

void PreviewGeneratorQueue::AddListener ( QObject *  listener) [static]

Definition at line 91 of file previewgeneratorqueue.cpp.

Referenced by PlaybackBox::Load(), and MainServer::MainServer().

void PreviewGeneratorQueue::RemoveListener ( QObject *  listener) [static]

Definition at line 100 of file previewgeneratorqueue.cpp.

Referenced by MainServer::Stop(), and PlaybackBox::~PlaybackBox().

QString PreviewGeneratorQueue::GeneratePreviewImage ( ProgramInfo pginfo,
const QSize &  size,
const QString &  outputfile,
long long  time,
bool  in_seconds,
QString  token 
) [private]

Definition at line 245 of file previewgeneratorqueue.cpp.

Referenced by event().

void PreviewGeneratorQueue::GetInfo ( const QString &  key,
uint queue_depth,
uint preview_tokens 
) [private]

Definition at line 419 of file previewgeneratorqueue.cpp.

Referenced by GeneratePreviewImage().

void PreviewGeneratorQueue::SetPreviewGenerator ( const QString &  key,
PreviewGenerator g 
) [private]

Sets the PreviewGenerator for a specific file.

Returns:
true iff call succeeded.

Definition at line 469 of file previewgeneratorqueue.cpp.

Referenced by GeneratePreviewImage().

void PreviewGeneratorQueue::IncPreviewGeneratorPriority ( const QString &  key,
QString  token 
) [private]

Definition at line 428 of file previewgeneratorqueue.cpp.

Referenced by GeneratePreviewImage(), and SetPreviewGenerator().

Definition at line 448 of file previewgeneratorqueue.cpp.

Referenced by event(), and GeneratePreviewImage().

bool PreviewGeneratorQueue::IsGeneratingPreview ( const QString &  key) const [private]

Returns true if we have already started a PreviewGenerator to create this file.

Definition at line 501 of file previewgeneratorqueue.cpp.

Referenced by GeneratePreviewImage().

uint PreviewGeneratorQueue::IncPreviewGeneratorAttempts ( const QString &  key) [private]

Increments and returns number of times we have started a PreviewGenerator to create this file.

Definition at line 519 of file previewgeneratorqueue.cpp.

Referenced by GeneratePreviewImage().

void PreviewGeneratorQueue::ClearPreviewGeneratorAttempts ( const QString &  key) [private]

Clears the number of times we have started a PreviewGenerator to create this file.

Definition at line 529 of file previewgeneratorqueue.cpp.

Referenced by GeneratePreviewImage().

bool PreviewGeneratorQueue::event ( QEvent *  e) [private, virtual]

Definition at line 109 of file previewgeneratorqueue.cpp.

void PreviewGeneratorQueue::SendEvent ( const ProgramInfo pginfo,
const QString &  eventname,
const QString &  fn,
const QString &  token,
const QString &  msg,
const QDateTime &  dt 
) [private]

Definition at line 223 of file previewgeneratorqueue.cpp.

Referenced by GeneratePreviewImage().


Member Data Documentation

QSet<QObject*> PreviewGeneratorQueue::m_listeners [private]

Definition at line 83 of file previewgeneratorqueue.h.

Referenced by AddListener(), event(), RemoveListener(), and SendEvent().

QMutex PreviewGeneratorQueue::m_lock [mutable, private]

Definition at line 86 of file previewgeneratorqueue.h.

Referenced by GeneratePreviewImage().

QMap<QString,QString> PreviewGeneratorQueue::m_tokenToKeyMap [private]

Definition at line 88 of file previewgeneratorqueue.h.

Referenced by event(), IncPreviewGeneratorPriority(), and SetPreviewGenerator().

QStringList PreviewGeneratorQueue::m_queue [private]

Definition at line 90 of file previewgeneratorqueue.h.

Referenced by event(), and UpdatePreviewGeneratorThreads().

Definition at line 91 of file previewgeneratorqueue.h.

Referenced by PreviewGeneratorQueue(), and UpdatePreviewGeneratorThreads().

Definition at line 92 of file previewgeneratorqueue.h.

Referenced by GeneratePreviewImage().

Definition at line 93 of file previewgeneratorqueue.h.

Referenced by event().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends