Go to the documentation of this file.
10 #define LOC QString("Editor: ")
15 qRegisterMetaType<MythEditorState>();
28 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Initialising editor");
56 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Cannot edit - no full position map");
143 bool handled =
false;
147 for (
int i = 0; i < Actions.size() && !handled; i++)
149 static constexpr
float FFREW_MULTICOUNT { 10.0F };
150 const QString&
action = Actions[i];
153 bool seekzero = qFuzzyCompare(seekamount + 1.0F, 1.0F);
160 else if (seekamount > 0)
177 else if (seekamount > 0)
215 else if (seekamount > 0)
224 else if (seekamount > 0)
235 else if (
action ==
"DELETE")
240 else if (
action ==
"REVERT")
245 else if (
action ==
"REVERTEXIT")
265 if (handled && (
action ==
"CUTTOBEGINNING" ||
action ==
"CUTTOEND" ||
action ==
"NEWCUT"))
267 else if (handled &&
action ==
"UNDO")
269 else if (handled &&
action ==
"REDO")
274 if (handled && refresh)
294 uint64_t targetFrame =
FindFrame(target, UseCutlist);
void SaveMap(bool isAutoSave=false)
Saves the delete map to the database.
void RefreshEditorState(bool CheckSaved=false)
void SaveEditing(bool edit)
Sets "editing" field in "recorded" table to "edit".
void UnlockPlayingInfo(const char *file, int line) const
uint64_t GetTotalFrameCount(void) const
CommBreakMap m_commBreakMap
void SetupAudioGraph(double VideoFrameRate)
void TrackerReset(uint64_t frame)
Resets the internal state tracker.
void DisableEdit(int HowToSave)
Leave cutlist edit mode, saving work in 1 of 3 ways.
bool LoadAutoSaveMap(void)
Returns true if an auto-save map was loaded.
uint64_t GetNearestMark(uint64_t frame, bool right, bool *hasMark=nullptr) const
Returns the next or previous mark.
std::chrono::milliseconds m_savedAudioTimecodeOffset
static constexpr const char * ACTION_LEFT
void SetFileEditing(bool edit)
Update the editing status in the file's ProgramInfo.
QMap< uint64_t, MarkTypes > frm_dir_map_t
Frame # -> Mark map.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
void HideAll(bool KeepSubs=true, MythScreenType *Except=nullptr, bool DropNotification=false)
void GetMap(frm_dir_map_t &map) const
#define ACTION_LOADCOMMSKIP
static constexpr const char * ACTION_SELECT
void SetOSDStatus(const QString &Title, OSDTimeout Timeout)
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
void SetEditing(bool edit, OSD *osd=nullptr)
Set the edit mode and optionally hide the edit mode OSD.
QString GetUndoMessage(void) const
static const double kInaccuracyNone
void UpdateOSDMessage(const QString &Message)
uint64_t GetFramesPlayed(void) const
float ComputeSecs(uint64_t position, bool use_cutlist) const
#define ACTION_BIGJUMPREW
void SetSeekAmount(float amount)
ProgramInfo * m_playingInfo
Currently playing info.
void NewCut(uint64_t frame)
Add a new cut marker (to start or end a cut region)
void LockPlayingInfo(const char *file, int line) const
uint64_t FindFrame(float offset, bool use_cutlist) const
MythPlayerEditorUI(MythMainWindow *MainWindow, TV *Tv, PlayerContext *Context, PlayerFlags Flags)
bool m_hasFullPositionMap
void HandleArbSeek(bool Direction)
bool IsInDelete(uint64_t frame) const
Returns true if the given frame is deemed to be within a region that should be cut.
void LoadMap(const QString &undoMessage="")
Loads the delete map from the database.
double m_videoFrameRate
Video (input) Frame Rate (often inaccurate)
PlayerContext * m_playerCtx
bool DoRewindSecs(float Seconds, double Inaccuracy, bool UseCutlist)
bool IsFileEditing(void)
Determines whether the file is currently in edit mode.
void LoadCommBreakMap(frm_dir_map_t &map)
Loads the given commercial break map into the deleteMap.
void DisableEdit(int HowToSave)
bool DoFastForward(uint64_t frames, double inaccuracy)
void InitialiseState() override
bool IsSaved(void) const
Compares the current cut list with the saved cut list.
void RefreshEditorState(bool CheckSaved=false)
void InitialiseState() override
Set initial state and update player.
static constexpr const char * ACTION_RIGHT
void Delete(uint64_t frame, const QString &undoMessage)
Remove the mark at the given frame.
QRecursiveMutex m_osdLock
QElapsedTimer m_editUpdateTimer
static const double kInaccuracyEditor
bool HasTemporaryMark(void) const
Returns true if a temporary placeholder mark is defined.
bool DoFastForwardSecs(float Seconds, double Inaccuracy, bool UseCutlist)
#define ACTION_BIGJUMPFWD
static const double kInaccuracyFull
bool HandleProgramEditorActions(const QStringList &Actions)
bool IsTemporaryMark(uint64_t frame) const
Returns true if the given frame is a temporary/placeholder mark.
float GetSeekAmount(void) const
bool HandleAction(const QString &action, uint64_t frame)
void EditorStateChanged(const MythEditorState &EditorState)
bool DoRewind(uint64_t frames, double inaccuracy)
void EditorStateChanged(const MythEditorState &EditorState)
void UpdateOSD(uint64_t frame, double frame_rate, OSD *osd)
Show and update the edit mode On Screen Display.
void UpdateSeekAmount(int change)
bool Play(float speed=1.0, bool normal=true, bool unpauseaudio=true)
QString GetRedoMessage(void) const