MythTV
master
|
#include <libmythtv/deletemap.h>
Public Member Functions | |
DeleteMap ()=default | |
void | SetPlayerContext (PlayerContext *ctx) |
bool | HandleAction (const QString &action, uint64_t frame) |
float | GetSeekAmount (void) const |
void | UpdateSeekAmount (int change) |
void | SetSeekAmount (float amount) |
void | UpdateOSD (uint64_t frame, double frame_rate, OSD *osd) |
Show and update the edit mode On Screen Display. More... | |
bool | IsEditing (void) const |
void | SetEditing (bool edit, OSD *osd=nullptr) |
Set the edit mode and optionally hide the edit mode OSD. More... | |
void | SetFileEditing (bool edit) |
Update the editing status in the file's ProgramInfo. More... | |
bool | IsFileEditing (void) |
Determines whether the file is currently in edit mode. More... | |
bool | IsEmpty (void) const |
bool | IsSaved (void) const |
Compares the current cut list with the saved cut list. More... | |
bool | IsChanged (void) const |
void | SetChanged (bool changed=true) |
void | SetMap (const frm_dir_map_t &map) |
Use the given map. More... | |
void | LoadCommBreakMap (frm_dir_map_t &map) |
Loads the given commercial break map into the deleteMap. More... | |
void | SaveMap (bool isAutoSave=false) |
Saves the delete map to the database. More... | |
void | LoadMap (const QString &undoMessage="") |
Loads the delete map from the database. More... | |
bool | LoadAutoSaveMap (void) |
Returns true if an auto-save map was loaded. More... | |
void | CleanMap (void) |
Removes redundant marks and ensures the markup sequence is valid. More... | |
void | Clear (const QString &undoMessage="") |
Clears the deleteMap. More... | |
void | ReverseAll (void) |
Reverses the direction of each mark in the map. More... | |
void | NewCut (uint64_t frame) |
Add a new cut marker (to start or end a cut region) More... | |
void | Delete (uint64_t frame, const QString &undoMessage) |
Remove the mark at the given frame. More... | |
void | MoveRelative (uint64_t frame, bool right) |
Move the previous (!right) or next (right) cut to frame. More... | |
void | Move (uint64_t frame, uint64_t to) |
Move an existing mark to a new frame. More... | |
bool | IsInDelete (uint64_t frame) const |
Returns true if the given frame is deemed to be within a region that should be cut. More... | |
uint64_t | GetNearestMark (uint64_t frame, bool right, bool *hasMark=nullptr) const |
Returns the next or previous mark. More... | |
bool | IsTemporaryMark (uint64_t frame) const |
Returns true if the given frame is a temporary/placeholder mark. More... | |
bool | HasTemporaryMark (void) const |
Returns true if a temporary placeholder mark is defined. More... | |
uint64_t | GetLastFrame (void) const |
Returns the number of the last frame in the video that is not in a cut sequence. More... | |
std::chrono::milliseconds | TranslatePositionFrameToMs (uint64_t position, float fallback_framerate, bool use_cutlist) const |
uint64_t | TranslatePositionMsToFrame (std::chrono::milliseconds dur_ms, float fallback_framerate, bool use_cutlist) const |
uint64_t | TranslatePositionAbsToRel (uint64_t position) const |
uint64_t | TranslatePositionRelToAbs (uint64_t position) const |
void | TrackerReset (uint64_t frame) |
Resets the internal state tracker. More... | |
bool | TrackerWantsToJump (uint64_t frame, uint64_t &to) const |
Returns true if the given frame has passed the last cut point start and provides the frame number of the next jump. More... | |
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 void | UpdateOSD (std::chrono::milliseconds timecode, OSD *osd) |
Private Member Functions | |
void | AddMark (uint64_t frame, MarkTypes type) |
Add a new mark of the given type. More... | |
void | Add (uint64_t frame, MarkTypes type) |
Private addition to the deleteMap. More... | |
MarkTypes | Delete (uint64_t frame) |
Private removal from the deleteMap. More... | |
void | Push (const QString &undoMessage) |
void | PushDeferred (const frm_dir_map_t &savedMap, const QString &undoMessage) |
QString | CreateTimeString (uint64_t frame, bool use_cutlist, double frame_rate, bool full_resolution) const |
Private Attributes | |
bool | m_editing {false} |
bool | m_nextCutStartIsValid {false} |
uint64_t | m_nextCutStart {0} |
frm_dir_map_t | m_deleteMap |
QString | m_seekText |
bool | m_changed {true} |
int | m_seekamountpos {4} |
float | m_seekamount {1.0F} |
PlayerContext * | m_ctx {nullptr} |
uint64_t | m_cachedTotalForOSD {0} |
QVector< DeleteMapUndoEntry > | m_undoStack |
int | m_undoStackPointer {0} |
Definition at line 26 of file deletemap.h.
|
default |
|
inline |
Definition at line 32 of file deletemap.h.
Referenced by MythPlayer::MythPlayer(), and Cutter::SetCutList().
bool DeleteMap::HandleAction | ( | const QString & | action, |
uint64_t | frame | ||
) |
Definition at line 87 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::HandleProgramEditorActions().
|
inline |
Definition at line 34 of file deletemap.h.
Referenced by MythPlayerEditorUI::HandleArbSeek(), and MythPlayerEditorUI::HandleProgramEditorActions().
void DeleteMap::UpdateSeekAmount | ( | int | change | ) |
Definition at line 140 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::EnableEdit(), and HandleAction().
|
inline |
Definition at line 36 of file deletemap.h.
Referenced by MythPlayerEditorUI::HandleProgramEditorActions().
void DeleteMap::UpdateOSD | ( | uint64_t | frame, |
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 177 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::EnableEdit(), MythPlayerUI::EventLoop(), MythPlayerEditorUI::HandleProgramEditorActions(), MythPlayerUI::RefreshPauseFrame(), and MythPlayerVideoUI::ReinitOSD().
|
static |
Definition at line 220 of file deletemap.cpp.
|
inline |
Definition at line 41 of file deletemap.h.
Referenced by MythPlayer::DecoderLoop(), MythPlayer::DoFastForward(), MythPlayerUI::EventLoop(), MythPlayer::Play(), MythPlayerUI::RefreshPauseFrame(), and MythPlayerVideoUI::ReinitOSD().
Set the edit mode and optionally hide the edit mode OSD.
Definition at line 226 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::DisableEdit(), and MythPlayerEditorUI::EnableEdit().
void DeleteMap::SetFileEditing | ( | bool | edit | ) |
Update the editing status in the file's ProgramInfo.
Definition at line 234 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::DisableEdit(), and MythPlayerEditorUI::EnableEdit().
bool DeleteMap::IsFileEditing | ( | void | ) |
Determines whether the file is currently in edit mode.
Definition at line 246 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::EnableEdit().
bool DeleteMap::IsEmpty | ( | void | ) | const |
Definition at line 259 of file deletemap.cpp.
Referenced by MythPlayer::CalcMaxFFTime(), CleanMap(), MythPlayerUI::EventLoop(), GetLastFrame(), MythPlayer::HasReachedEof(), TrackerReset(), TrackerWantsToJump(), and MythTranscodePlayer::TranscodeGetNextFrame().
bool DeleteMap::IsSaved | ( | void | ) | const |
Compares the current cut list with the saved cut list.
Definition at line 879 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::RefreshEditorState().
|
inline |
Definition at line 47 of file deletemap.h.
Referenced by MythPlayerVideoUI::ReinitOSD().
Definition at line 48 of file deletemap.h.
Referenced by MythPlayerVideoUI::ReinitOSD().
void DeleteMap::SetMap | ( | const frm_dir_map_t & | map | ) |
Use the given map.
Definition at line 720 of file deletemap.cpp.
Referenced by MythTranscodePlayer::SetCutList(), and Cutter::SetCutList().
void DeleteMap::LoadCommBreakMap | ( | frm_dir_map_t & | map | ) |
Loads the given commercial break map into the deleteMap.
Definition at line 731 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::HandleProgramEditorActions().
Saves the delete map to the database.
Definition at line 778 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::DisableEdit(), MythPlayerEditorUI::HandleProgramEditorActions(), Push(), PushDeferred(), Redo(), and Undo().
void DeleteMap::LoadMap | ( | const QString & | undoMessage = "" | ) |
Loads the delete map from the database.
Definition at line 742 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::DisableEdit(), MythPlayerEditorUI::HandleProgramEditorActions(), MythPlayer::OpenFile(), and MythPreviewPlayer::SeekForScreenGrab().
bool DeleteMap::LoadAutoSaveMap | ( | void | ) |
Returns true if an auto-save map was loaded.
Does nothing and returns false if not.
Definition at line 758 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::EnableEdit().
void DeleteMap::CleanMap | ( | void | ) |
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 664 of file deletemap.cpp.
Referenced by AddMark(), Delete(), LoadAutoSaveMap(), LoadCommBreakMap(), LoadMap(), NewCut(), ReverseAll(), SaveMap(), and UpdateOSD().
void DeleteMap::Clear | ( | const QString & | undoMessage = "" | ) |
Clears the deleteMap.
Definition at line 265 of file deletemap.cpp.
Referenced by HandleAction(), LoadAutoSaveMap(), LoadCommBreakMap(), LoadMap(), and SetMap().
void DeleteMap::ReverseAll | ( | void | ) |
Reverses the direction of each mark in the map.
Definition at line 274 of file deletemap.cpp.
Referenced by HandleAction().
void DeleteMap::NewCut | ( | uint64_t | frame | ) |
Add a new cut marker (to start or end a cut region)
Definition at line 397 of file deletemap.cpp.
Referenced by HandleAction(), and MythPlayerEditorUI::HandleProgramEditorActions().
void DeleteMap::Delete | ( | uint64_t | frame, |
const QString & | undoMessage | ||
) |
Remove the mark at the given frame.
Definition at line 364 of file deletemap.cpp.
Referenced by AddMark(), CleanMap(), HandleAction(), MythPlayerEditorUI::HandleProgramEditorActions(), Move(), MoveRelative(), and NewCut().
void DeleteMap::MoveRelative | ( | uint64_t | frame, |
bool | right | ||
) |
Move the previous (!right) or next (right) cut to frame.
Definition at line 503 of file deletemap.cpp.
Referenced by HandleAction().
void DeleteMap::Move | ( | uint64_t | frame, |
uint64_t | to | ||
) |
Move an existing mark to a new frame.
Definition at line 538 of file deletemap.cpp.
Referenced by MoveRelative().
bool DeleteMap::IsInDelete | ( | uint64_t | frame | ) | const |
Returns true if the given frame is deemed to be within a region that should be cut.
Definition at line 575 of file deletemap.cpp.
Referenced by MythPlayer::IsInDelete(), NewCut(), MythPlayerEditorUI::RefreshEditorState(), TrackerReset(), and UpdateOSD().
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 not nullptr, it is set to true if the next/previous mark exists, and false otherwise.
Definition at line 615 of file deletemap.cpp.
Referenced by Delete(), MythPlayerEditorUI::HandleArbSeek(), MoveRelative(), NewCut(), MythPlayerEditorUI::RefreshEditorState(), TrackerReset(), and TrackerWantsToJump().
bool DeleteMap::IsTemporaryMark | ( | uint64_t | frame | ) | const |
Returns true if the given frame is a temporary/placeholder mark.
Definition at line 600 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::RefreshEditorState().
bool DeleteMap::HasTemporaryMark | ( | void | ) | const |
Returns true if a temporary placeholder mark is defined.
Definition at line 647 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::RefreshEditorState().
uint64_t DeleteMap::GetLastFrame | ( | void | ) | const |
Returns the number of the last frame in the video that is not in a cut sequence.
Definition at line 862 of file deletemap.cpp.
Referenced by MythPlayer::CalcMaxFFTime(), MythPlayer::DoFastForward(), MythPlayer::HasReachedEof(), and MythPlayer::IsNearEnd().
std::chrono::milliseconds DeleteMap::TranslatePositionFrameToMs | ( | uint64_t | position, |
float | fallback_framerate, | ||
bool | use_cutlist | ||
) | const |
Definition at line 902 of file deletemap.cpp.
Referenced by CreateTimeString(), and MythPlayer::TranslatePositionFrameToMs().
uint64_t DeleteMap::TranslatePositionMsToFrame | ( | std::chrono::milliseconds | dur_ms, |
float | fallback_framerate, | ||
bool | use_cutlist | ||
) | const |
Definition at line 911 of file deletemap.cpp.
uint64_t DeleteMap::TranslatePositionAbsToRel | ( | uint64_t | position | ) | const |
Definition at line 921 of file deletemap.cpp.
uint64_t DeleteMap::TranslatePositionRelToAbs | ( | uint64_t | position | ) | const |
Definition at line 926 of file deletemap.cpp.
void DeleteMap::TrackerReset | ( | uint64_t | frame | ) |
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 811 of file deletemap.cpp.
Referenced by Cutter::Activate(), MythPlayer::ClearAfterSeek(), MythPlayerEditorUI::DisableEdit(), Cutter::NewFrame(), MythPlayer::OpenFile(), and MythTranscodePlayer::TranscodeGetNextFrame().
bool DeleteMap::TrackerWantsToJump | ( | uint64_t | frame, |
uint64_t & | to | ||
) | const |
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 847 of file deletemap.cpp.
Referenced by MythPlayerUI::EventLoop(), Cutter::NewFrame(), MythPlayer::OpenFile(), and MythTranscodePlayer::TranscodeGetNextFrame().
bool DeleteMap::Undo | ( | void | ) |
Definition at line 49 of file deletemap.cpp.
Referenced by HandleAction().
bool DeleteMap::Redo | ( | void | ) |
Definition at line 62 of file deletemap.cpp.
Referenced by HandleAction().
|
inline |
Definition at line 87 of file deletemap.h.
Referenced by GetUndoMessage(), MythPlayerEditorUI::RefreshEditorState(), and Undo().
|
inline |
Definition at line 88 of file deletemap.h.
Referenced by GetRedoMessage(), Redo(), and MythPlayerEditorUI::RefreshEditorState().
QString DeleteMap::GetUndoMessage | ( | void | ) | const |
Definition at line 75 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::HandleProgramEditorActions(), and MythPlayerEditorUI::RefreshEditorState().
QString DeleteMap::GetRedoMessage | ( | void | ) | const |
Definition at line 81 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::HandleProgramEditorActions(), and MythPlayerEditorUI::RefreshEditorState().
|
private |
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 289 of file deletemap.cpp.
Referenced by HandleAction(), and Move().
|
private |
Private addition to the deleteMap.
Definition at line 554 of file deletemap.cpp.
Referenced by AddMark(), LoadCommBreakMap(), NewCut(), and ReverseAll().
|
private |
Private removal from the deleteMap.
Definition at line 561 of file deletemap.cpp.
|
private |
Definition at line 26 of file deletemap.cpp.
Referenced by Clear(), Delete(), HandleAction(), LoadCommBreakMap(), LoadMap(), Move(), PushDeferred(), and ReverseAll().
|
private |
Definition at line 37 of file deletemap.cpp.
Referenced by LoadAutoSaveMap(), and NewCut().
|
private |
Definition at line 162 of file deletemap.cpp.
Referenced by UpdateOSD().
Definition at line 105 of file deletemap.h.
Referenced by SetEditing().
Definition at line 106 of file deletemap.h.
Referenced by TrackerReset(), and TrackerWantsToJump().
|
private |
Definition at line 107 of file deletemap.h.
Referenced by TrackerReset(), and TrackerWantsToJump().
|
private |
Definition at line 108 of file deletemap.h.
Referenced by Add(), AddMark(), CleanMap(), Clear(), Delete(), GetLastFrame(), GetNearestMark(), HasTemporaryMark(), IsEmpty(), IsInDelete(), IsSaved(), IsTemporaryMark(), LoadAutoSaveMap(), LoadMap(), MoveRelative(), NewCut(), Push(), PushDeferred(), Redo(), ReverseAll(), SaveMap(), SetMap(), TrackerReset(), TranslatePositionAbsToRel(), TranslatePositionFrameToMs(), TranslatePositionMsToFrame(), TranslatePositionRelToAbs(), Undo(), and UpdateOSD().
|
private |
Definition at line 109 of file deletemap.h.
Referenced by UpdateOSD(), and UpdateSeekAmount().
Definition at line 110 of file deletemap.h.
Referenced by Add(), Clear(), Delete(), NewCut(), Redo(), SaveMap(), Undo(), and UpdateOSD().
|
private |
Definition at line 111 of file deletemap.h.
Referenced by UpdateSeekAmount().
|
private |
Definition at line 112 of file deletemap.h.
Referenced by UpdateSeekAmount().
|
private |
Definition at line 113 of file deletemap.h.
Referenced by CleanMap(), GetLastFrame(), GetNearestMark(), HandleAction(), IsFileEditing(), IsSaved(), LoadAutoSaveMap(), LoadMap(), Move(), NewCut(), SaveMap(), SetFileEditing(), TrackerReset(), TranslatePositionFrameToMs(), TranslatePositionMsToFrame(), and UpdateOSD().
|
private |
Definition at line 114 of file deletemap.h.
Referenced by UpdateOSD().
|
private |
Definition at line 116 of file deletemap.h.
Referenced by GetRedoMessage(), GetUndoMessage(), Push(), Redo(), and Undo().
|
private |
Definition at line 117 of file deletemap.h.
Referenced by GetRedoMessage(), GetUndoMessage(), Push(), Redo(), and Undo().