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

#include <deletemap.h>

List of all members.

Public Member Functions

 DeleteMap ()
void SetPlayerContext (PlayerContext *ctx)
bool HandleAction (QString &action, uint64_t frame, uint64_t played, uint64_t total, double rate)
int GetSeekAmount (void) const
void UpdateSeekAmount (int change, double framerate)
void SetSeekAmount (int amount)
void UpdateOSD (uint64_t frame, uint64_t total, double frame_rate, OSD *osd)
 Show and update the edit mode On Screen Display.
bool IsEditing (void) const
void SetEditing (bool edit, OSD *osd=NULL)
 Set the edit mode and optionally hide the edit mode OSD.
void SetFileEditing (bool edit)
 Update the editing status in the file's ProgramInfo.
bool IsFileEditing (void)
 Determines whether the file is currently in edit mode.
bool IsEmpty (void) const
bool IsSaved (void) const
 Compares the current cut list with the saved cut list.
void SetMap (const frm_dir_map_t &map)
 Use the given map.
void LoadCommBreakMap (uint64_t total, frm_dir_map_t &map)
 Loads the given commercial break map into the deleteMap.
void SaveMap (uint64_t total, bool isAutoSave=false)
 Saves the delete map to the database.
void LoadMap (uint64_t total, QString undoMessage="")
 Loads the delete map from the database.
bool LoadAutoSaveMap (uint64_t total)
 Returns true if an auto-save map was loaded.
void CleanMap (uint64_t total)
 Removes redundant marks and ensures the markup sequence is valid.
void Clear (QString undoMessage="")
 Clears the deleteMap.
void ReverseAll (uint64_t total)
 Reverses the direction of each mark in the map.
void Add (uint64_t frame, uint64_t total, MarkTypes type, QString undoMessage)
 Add a new mark of the given type.
void NewCut (uint64_t frame, uint64_t total)
 Add a new cut marker (to start or end a cut region)
void Delete (uint64_t frame, uint64_t total, QString undoMessage="")
 Remove the mark at the given frame.
void MoveRelative (uint64_t frame, uint64_t total, bool right)
 Move the previous (!right) or next (right) cut to frame.
void Move (uint64_t frame, uint64_t to, uint64_t total)
 Move an existing mark to a new frame.
bool IsInDelete (uint64_t frame) const
 Returns true if the given frame is deemed to be within a region that should be cut.
uint64_t GetNearestMark (uint64_t frame, uint64_t total, bool right, bool *hasMark=0) const
 Returns the next or previous mark.
bool IsTemporaryMark (uint64_t frame) const
 Returns true if the given frame is a temporary/placeholder mark.
bool HasTemporaryMark (void) const
 Returns true if a temporary placeholder mark is defined.
uint64_t GetLastFrame (uint64_t total) const
 Returns the number of the last frame in the video that is not in a cut sequence.
uint64_t TranslatePositionAbsToRel (uint64_t absPosition) const
uint64_t TranslatePositionRelToAbs (uint64_t relPosition) const
void TrackerReset (uint64_t frame, uint64_t total)
 Resets the internal state tracker.
bool TrackerWantsToJump (uint64_t frame, uint64_t total, uint64_t &to)
 Returns true if the given frame has passed the last cut point start and provides the frame number of the next jump.
bool Undo (void)
bool Redo (void)
bool HasUndo (void) const
bool HasRedo (void) const
QString GetUndoMessage (void) const
QString GetRedoMessage (void) const

Static Public Member Functions

static uint64_t TranslatePositionAbsToRel (const frm_dir_map_t &deleteMap, uint64_t absPosition)
static uint64_t TranslatePositionRelToAbs (const frm_dir_map_t &deleteMap, uint64_t relPosition)

Private Member Functions

void Add (uint64_t frame, MarkTypes type)
 Private addition to the deleteMap.
MarkTypes Delete (uint64_t frame)
 Private removal from the deleteMap.
void Push (QString undoMessage)

Private Attributes

bool m_editing
bool m_nextCutStartIsValid
uint64_t m_nextCutStart
frm_dir_map_t m_deleteMap
QString m_seekText
bool m_changed
int m_seekamountpos
int m_seekamount
PlayerContextm_ctx
uint64_t m_cachedTotalForOSD
QVector< DeleteMapUndoEntrym_undoStack
int m_undoStackPointer

Detailed Description

Definition at line 19 of file deletemap.h.


Constructor & Destructor Documentation

DeleteMap::DeleteMap ( ) [inline]

Definition at line 22 of file deletemap.h.


Member Function Documentation

Definition at line 31 of file deletemap.h.

Referenced by MythPlayer::SetPlayerInfo().

bool DeleteMap::HandleAction ( QString &  action,
uint64_t  frame,
uint64_t  played,
uint64_t  total,
double  rate 
)

Definition at line 73 of file deletemap.cpp.

Referenced by MythPlayer::HandleProgramEditorActions().

int DeleteMap::GetSeekAmount ( void  ) const [inline]
void DeleteMap::UpdateSeekAmount ( int  change,
double  framerate 
)

Definition at line 112 of file deletemap.cpp.

Referenced by MythPlayer::EnableEdit(), and HandleAction().

void DeleteMap::SetSeekAmount ( int  amount) [inline]

Definition at line 36 of file deletemap.h.

Referenced by MythPlayer::HandleProgramEditorActions().

void DeleteMap::UpdateOSD ( uint64_t  frame,
uint64_t  total,
double  frame_rate,
OSD osd 
)

Show and update the edit mode On Screen Display.

The cut regions are only refreshed if the deleteMap has been updated.

Definition at line 157 of file deletemap.cpp.

Referenced by MythPlayer::EnableEdit(), MythPlayer::EventLoop(), and MythPlayer::HandleProgramEditorActions().

bool DeleteMap::IsEditing ( void  ) const [inline]
void DeleteMap::SetEditing ( bool  edit,
OSD osd = NULL 
)

Set the edit mode and optionally hide the edit mode OSD.

Definition at line 202 of file deletemap.cpp.

Referenced by MythPlayer::DisableEdit(), and MythPlayer::EnableEdit().

Update the editing status in the file's ProgramInfo.

Definition at line 210 of file deletemap.cpp.

Referenced by MythPlayer::DisableEdit(), and MythPlayer::EnableEdit().

Determines whether the file is currently in edit mode.

Definition at line 222 of file deletemap.cpp.

Referenced by MythPlayer::EnableEdit().

Compares the current cut list with the saved cut list.

Definition at line 839 of file deletemap.cpp.

Use the given map.

Definition at line 682 of file deletemap.cpp.

Referenced by MythPlayer::SetCutList().

Loads the given commercial break map into the deleteMap.

Definition at line 693 of file deletemap.cpp.

Referenced by MythPlayer::HandleProgramEditorActions().

void DeleteMap::SaveMap ( uint64_t  total,
bool  isAutoSave = false 
)

Saves the delete map to the database.

Definition at line 741 of file deletemap.cpp.

Referenced by MythPlayer::DisableEdit(), MythPlayer::HandleProgramEditorActions(), Push(), Redo(), and Undo().

void DeleteMap::LoadMap ( uint64_t  total,
QString  undoMessage = "" 
)

Loads the delete map from the database.

Definition at line 705 of file deletemap.cpp.

Referenced by MythPlayer::DisableEdit(), MythPlayer::HandleProgramEditorActions(), MythPlayer::OpenFile(), and MythPlayer::SeekForScreenGrab().

Returns true if an auto-save map was loaded.

Does nothing and returns false if not.

Definition at line 721 of file deletemap.cpp.

Referenced by MythPlayer::EnableEdit().

Removes redundant marks and ensures the markup sequence is valid.

A valid sequence is 1 or more marks of alternating values and does not include the first or last frames.

Definition at line 635 of file deletemap.cpp.

Referenced by Add(), Delete(), LoadAutoSaveMap(), LoadCommBreakMap(), LoadMap(), NewCut(), ReverseAll(), SaveMap(), and UpdateOSD().

void DeleteMap::Clear ( QString  undoMessage = "")

Clears the deleteMap.

Definition at line 241 of file deletemap.cpp.

Referenced by HandleAction(), LoadAutoSaveMap(), LoadCommBreakMap(), LoadMap(), and SetMap().

Reverses the direction of each mark in the map.

Definition at line 250 of file deletemap.cpp.

Referenced by HandleAction().

void DeleteMap::Add ( uint64_t  frame,
uint64_t  total,
MarkTypes  type,
QString  undoMessage 
)

Add a new mark of the given type.

Before the new mark is added, any existing redundant mark of that type is removed. This simplifies the cleanup code.

Definition at line 266 of file deletemap.cpp.

Referenced by HandleAction(), LoadCommBreakMap(), Move(), NewCut(), and ReverseAll().

void DeleteMap::NewCut ( uint64_t  frame,
uint64_t  total 
)

Add a new cut marker (to start or end a cut region)

Definition at line 373 of file deletemap.cpp.

Referenced by HandleAction(), and MythPlayer::HandleProgramEditorActions().

void DeleteMap::Delete ( uint64_t  frame,
uint64_t  total,
QString  undoMessage = "" 
)

Remove the mark at the given frame.

Definition at line 341 of file deletemap.cpp.

Referenced by Add(), CleanMap(), HandleAction(), MythPlayer::HandleProgramEditorActions(), Move(), MoveRelative(), and NewCut().

void DeleteMap::MoveRelative ( uint64_t  frame,
uint64_t  total,
bool  right 
)

Move the previous (!right) or next (right) cut to frame.

Definition at line 472 of file deletemap.cpp.

Referenced by HandleAction().

void DeleteMap::Move ( uint64_t  frame,
uint64_t  to,
uint64_t  total 
)

Move an existing mark to a new frame.

Definition at line 506 of file deletemap.cpp.

Referenced by MoveRelative().

Returns true if the given frame is deemed to be within a region that should be cut.

Definition at line 542 of file deletemap.cpp.

Referenced by MythPlayer::IsInDelete(), NewCut(), TrackerReset(), and UpdateOSD().

uint64_t DeleteMap::GetNearestMark ( uint64_t  frame,
uint64_t  total,
bool  right,
bool hasMark = 0 
) const

Returns the next or previous mark.

If these do not exist, returns either zero (the first frame) or total (the last frame). If hasMark is non-NULL, it is set to true if the next/previous mark exists, and false otherwise.

Definition at line 584 of file deletemap.cpp.

Referenced by Delete(), MythPlayer::GetNearestMark(), MythPlayer::HandleArbSeek(), MoveRelative(), NewCut(), TrackerReset(), and TrackerWantsToJump().

Returns true if the given frame is a temporary/placeholder mark.

Definition at line 569 of file deletemap.cpp.

Referenced by MythPlayer::IsTemporaryMark().

Returns true if a temporary placeholder mark is defined.

Definition at line 617 of file deletemap.cpp.

Referenced by MythPlayer::HasTemporaryMark().

Returns the number of the last frame in the video that is not in a cut sequence.

Definition at line 822 of file deletemap.cpp.

Referenced by MythPlayer::DoFastForward(), and MythPlayer::IsNearEnd().

uint64_t DeleteMap::TranslatePositionAbsToRel ( uint64_t  absPosition) const [inline]

Definition at line 69 of file deletemap.h.

Referenced by MythPlayer::calcSliderPos(), and UpdateOSD().

uint64_t DeleteMap::TranslatePositionRelToAbs ( uint64_t  relPosition) const [inline]

Definition at line 72 of file deletemap.h.

uint64_t DeleteMap::TranslatePositionAbsToRel ( const frm_dir_map_t deleteMap,
uint64_t  absPosition 
) [static]

Definition at line 862 of file deletemap.cpp.

uint64_t DeleteMap::TranslatePositionRelToAbs ( const frm_dir_map_t deleteMap,
uint64_t  relPosition 
) [static]

Definition at line 893 of file deletemap.cpp.

Resets the internal state tracker.

The tracker records the frame at which the next cut sequence begins. This is used by the player to avoid iterating over the entire map many times per second.

Definition at line 774 of file deletemap.cpp.

Referenced by MythPlayer::ClearAfterSeek(), MythPlayer::DisableEdit(), MythPlayer::OpenFile(), and MythPlayer::TranscodeGetNextFrame().

Returns true if the given frame has passed the last cut point start and provides the frame number of the next jump.

Definition at line 807 of file deletemap.cpp.

Referenced by MythPlayer::EventLoop(), MythPlayer::OpenFile(), and MythPlayer::TranscodeGetNextFrame().

Definition at line 39 of file deletemap.cpp.

Referenced by HandleAction().

Definition at line 50 of file deletemap.cpp.

Referenced by HandleAction().

bool DeleteMap::HasUndo ( void  ) const [inline]

Definition at line 85 of file deletemap.h.

Referenced by GetUndoMessage(), and Undo().

bool DeleteMap::HasRedo ( void  ) const [inline]

Definition at line 86 of file deletemap.h.

Referenced by GetRedoMessage(), and Redo().

QString DeleteMap::GetUndoMessage ( void  ) const

Definition at line 61 of file deletemap.cpp.

Referenced by MythPlayer::HandleProgramEditorActions().

QString DeleteMap::GetRedoMessage ( void  ) const

Definition at line 67 of file deletemap.cpp.

Referenced by MythPlayer::HandleProgramEditorActions().

void DeleteMap::Add ( uint64_t  frame,
MarkTypes  type 
) [private]

Private addition to the deleteMap.

Definition at line 521 of file deletemap.cpp.

MarkTypes DeleteMap::Delete ( uint64_t  frame) [private]

Private removal from the deleteMap.

Definition at line 528 of file deletemap.cpp.

void DeleteMap::Push ( QString  undoMessage) [private]

Member Data Documentation

Definition at line 97 of file deletemap.h.

Referenced by SetEditing().

Definition at line 98 of file deletemap.h.

Referenced by TrackerReset(), and TrackerWantsToJump().

Definition at line 99 of file deletemap.h.

Referenced by TrackerReset(), and TrackerWantsToJump().

QString DeleteMap::m_seekText [private]

Definition at line 101 of file deletemap.h.

Referenced by UpdateOSD(), and UpdateSeekAmount().

Definition at line 102 of file deletemap.h.

Referenced by Add(), Clear(), Delete(), Redo(), SaveMap(), Undo(), and UpdateOSD().

Definition at line 103 of file deletemap.h.

Referenced by UpdateSeekAmount().

Definition at line 104 of file deletemap.h.

Referenced by UpdateSeekAmount().

Definition at line 106 of file deletemap.h.

Referenced by UpdateOSD().

Definition at line 109 of file deletemap.h.

Referenced by GetRedoMessage(), GetUndoMessage(), Push(), Redo(), and Undo().

Definition at line 110 of file deletemap.h.

Referenced by GetRedoMessage(), GetUndoMessage(), Push(), Redo(), and Undo().


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