|
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 |
|
private |
Private addition to the deleteMap.
Definition at line 565 of file deletemap.cpp.
Referenced by AddMark(), LoadCommBreakMap(), NewCut(), and ReverseAll().
|
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 301 of file deletemap.cpp.
Referenced by HandleAction(), and Move().
| 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 675 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 277 of file deletemap.cpp.
Referenced by HandleAction(), LoadAutoSaveMap(), LoadCommBreakMap(), LoadMap(), and SetMap().
|
private |
Definition at line 174 of file deletemap.cpp.
Referenced by UpdateOSD().
|
private |
Private removal from the deleteMap.
Definition at line 572 of file deletemap.cpp.
| void DeleteMap::Delete | ( | uint64_t | frame, |
| const QString & | undoMessage | ||
| ) |
Remove the mark at the given frame.
Definition at line 373 of file deletemap.cpp.
Referenced by AddMark(), CleanMap(), Delete(), HandleAction(), MythPlayerEditorUI::HandleProgramEditorActions(), Move(), MoveRelative(), and NewCut().
| 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 875 of file deletemap.cpp.
Referenced by MythPlayer::CalcMaxFFTime(), MythPlayer::DoFastForward(), MythPlayer::HasReachedEof(), and MythPlayer::IsNearEnd().
| uint64_t DeleteMap::GetNearestMark | ( | uint64_t | frame, |
| bool | right, | ||
| bool * | hasMark = nullptr |
||
| ) | 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 not nullptr, it is set to true if the next/previous mark exists, and false otherwise.
Definition at line 626 of file deletemap.cpp.
Referenced by Delete(), MythPlayerEditorUI::HandleArbSeek(), MoveRelative(), NewCut(), MythPlayerEditorUI::RefreshEditorState(), TrackerReset(), and TrackerWantsToJump().
| QString DeleteMap::GetRedoMessage | ( | void | ) | const |
Definition at line 81 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::HandleProgramEditorActions(), and MythPlayerEditorUI::RefreshEditorState().
|
inline |
Definition at line 34 of file deletemap.h.
Referenced by MythPlayerEditorUI::HandleArbSeek(), and MythPlayerEditorUI::HandleProgramEditorActions().
| QString DeleteMap::GetUndoMessage | ( | void | ) | const |
Definition at line 75 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::HandleProgramEditorActions(), and MythPlayerEditorUI::RefreshEditorState().
| 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 88 of file deletemap.h.
Referenced by GetRedoMessage(), Redo(), and MythPlayerEditorUI::RefreshEditorState().
| bool DeleteMap::HasTemporaryMark | ( | void | ) | const |
Returns true if a temporary placeholder mark is defined.
Definition at line 658 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::RefreshEditorState().
|
inline |
Definition at line 87 of file deletemap.h.
Referenced by GetUndoMessage(), MythPlayerEditorUI::RefreshEditorState(), and Undo().
|
inline |
Definition at line 47 of file deletemap.h.
Referenced by MythPlayerVideoUI::ReinitOSD().
|
inline |
Definition at line 41 of file deletemap.h.
Referenced by MythPlayer::DecoderLoop(), MythPlayer::DoFastForward(), MythPlayerUI::EventLoop(), MythPlayer::Play(), MythPlayerUI::RefreshPauseFrame(), and MythPlayerVideoUI::ReinitOSD().
| bool DeleteMap::IsEmpty | ( | void | ) | const |
Definition at line 271 of file deletemap.cpp.
Referenced by MythPlayer::CalcMaxFFTime(), CleanMap(), MythPlayerUI::EventLoop(), GetLastFrame(), MythPlayer::HasReachedEof(), TrackerReset(), TrackerWantsToJump(), and MythTranscodePlayer::TranscodeGetNextFrame().
| bool DeleteMap::IsFileEditing | ( | void | ) |
Determines whether the file is currently in edit mode.
Definition at line 258 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::EnableEdit().
| 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 586 of file deletemap.cpp.
Referenced by MythPlayer::IsInDelete(), NewCut(), MythPlayerEditorUI::RefreshEditorState(), TrackerReset(), and UpdateOSD().
| bool DeleteMap::IsSaved | ( | void | ) | const |
Compares the current cut list with the saved cut list.
Definition at line 892 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::RefreshEditorState().
| bool DeleteMap::IsTemporaryMark | ( | uint64_t | frame | ) | const |
Returns true if the given frame is a temporary/placeholder mark.
Definition at line 611 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::RefreshEditorState().
| bool DeleteMap::LoadAutoSaveMap | ( | void | ) |
Returns true if an auto-save map was loaded.
Does nothing and returns false if not.
Definition at line 769 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::EnableEdit().
| void DeleteMap::LoadCommBreakMap | ( | frm_dir_map_t & | map | ) |
Loads the given commercial break map into the deleteMap.
Definition at line 742 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::HandleProgramEditorActions().
| void DeleteMap::LoadMap | ( | const QString & | undoMessage = "" | ) |
Loads the delete map from the database.
Definition at line 753 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::DisableEdit(), MythPlayerEditorUI::HandleProgramEditorActions(), MythPlayer::OpenFile(), and MythPreviewPlayer::SeekForScreenGrab().
| void DeleteMap::Move | ( | uint64_t | frame, |
| uint64_t | to | ||
| ) |
Move an existing mark to a new frame.
Definition at line 549 of file deletemap.cpp.
Referenced by MoveRelative().
| void DeleteMap::MoveRelative | ( | uint64_t | frame, |
| bool | right | ||
| ) |
Move the previous (!right) or next (right) cut to frame.
Definition at line 514 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 406 of file deletemap.cpp.
Referenced by HandleAction(), and MythPlayerEditorUI::HandleProgramEditorActions().
|
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().
| bool DeleteMap::Redo | ( | void | ) |
Definition at line 62 of file deletemap.cpp.
Referenced by HandleAction().
| void DeleteMap::ReverseAll | ( | void | ) |
Reverses the direction of each mark in the map.
Definition at line 286 of file deletemap.cpp.
Referenced by HandleAction().
| void DeleteMap::SaveMap | ( | bool | isAutoSave = false | ) |
Saves the delete map to the database.
Definition at line 789 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::DisableEdit(), MythPlayerEditorUI::HandleProgramEditorActions(), Push(), PushDeferred(), Redo(), and Undo().
|
inline |
Definition at line 48 of file deletemap.h.
Referenced by MythPlayerVideoUI::ReinitOSD().
| void DeleteMap::SetEditing | ( | bool | edit, |
| OSD * | osd = nullptr |
||
| ) |
Set the edit mode and optionally hide the edit mode OSD.
Definition at line 238 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 246 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::DisableEdit(), and MythPlayerEditorUI::EnableEdit().
| void DeleteMap::SetMap | ( | const frm_dir_map_t & | map | ) |
Use the given map.
Definition at line 731 of file deletemap.cpp.
Referenced by MythTranscodePlayer::SetCutList(), and Cutter::SetCutList().
|
inline |
Definition at line 32 of file deletemap.h.
Referenced by MythPlayer::MythPlayer(), and Cutter::SetCutList().
|
inline |
Definition at line 36 of file deletemap.h.
Referenced by MythPlayerEditorUI::HandleProgramEditorActions().
| 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 824 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 860 of file deletemap.cpp.
Referenced by MythPlayerUI::EventLoop(), Cutter::NewFrame(), MythPlayer::OpenFile(), and MythTranscodePlayer::TranscodeGetNextFrame().
| uint64_t DeleteMap::TranslatePositionAbsToRel | ( | uint64_t | position | ) | const |
Definition at line 934 of file deletemap.cpp.
| std::chrono::milliseconds DeleteMap::TranslatePositionFrameToMs | ( | uint64_t | position, |
| float | fallback_framerate, | ||
| bool | use_cutlist | ||
| ) | const |
Definition at line 915 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 924 of file deletemap.cpp.
| uint64_t DeleteMap::TranslatePositionRelToAbs | ( | uint64_t | position | ) | const |
Definition at line 939 of file deletemap.cpp.
| bool DeleteMap::Undo | ( | void | ) |
Definition at line 49 of file deletemap.cpp.
Referenced by HandleAction().
|
static |
Definition at line 232 of file deletemap.cpp.
| 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 189 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::EnableEdit(), MythPlayerUI::EventLoop(), MythPlayerEditorUI::HandleProgramEditorActions(), MythPlayerUI::RefreshPauseFrame(), and MythPlayerVideoUI::ReinitOSD().
| void DeleteMap::UpdateSeekAmount | ( | int | change | ) |
Definition at line 152 of file deletemap.cpp.
Referenced by MythPlayerEditorUI::EnableEdit(), and HandleAction().
|
private |
Definition at line 114 of file deletemap.h.
Referenced by UpdateOSD().
|
private |
Definition at line 110 of file deletemap.h.
Referenced by Add(), Clear(), Delete(), NewCut(), Redo(), SaveMap(), Undo(), and UpdateOSD().
|
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 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 105 of file deletemap.h.
Referenced by SetEditing().
|
private |
Definition at line 107 of file deletemap.h.
Referenced by TrackerReset(), and TrackerWantsToJump().
|
private |
Definition at line 106 of file deletemap.h.
Referenced by TrackerReset(), and TrackerWantsToJump().
|
private |
Definition at line 112 of file deletemap.h.
Referenced by UpdateSeekAmount().
|
private |
Definition at line 111 of file deletemap.h.
Referenced by UpdateSeekAmount().
|
private |
Definition at line 109 of file deletemap.h.
Referenced by UpdateOSD(), and UpdateSeekAmount().
|
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().