<commit_before>local log								= require("hs.logger").new("timline")
local inspect							= require("hs.inspect")

local just								= require("hs.just")
local axutils							= require("hs.finalcutpro.axutils")

local Playhead = {}

function Playhead:new(parent)
	o = {_parent = parent}
	setmetatable(o, self)
	self.__index = self
	return o
end

function Playhead:parent()
	return self._parent
end

function Playhead:app()
	return self:parent():app()
end

-----------------------------------------------------------------------
-----------------------------------------------------------------------
--- BROWSER UI
-----------------------------------------------------------------------
-----------------------------------------------------------------------
function Playhead:UI()
	return axutils.cache(self, "_ui", function()
		local ui = self:parent():UI()
		if ui then
			return axutils.childWith(ui, "AXRole", "AXValueIndicator")
		end
		return nil
	end)
end

function Playhead:isShowing()
	return self:UI() ~= nil
end

function Playhead:show()
	local parent = self:parent()
	-- show the parent.
	if parent:show() then
		-- ensure the playhead is visible
		-- TODO
	end
	return self
end

function Playhead:hide()
	return self:parent():hide()
end
<commit_msg>#64 * Fixed bug where making edits on the timeline would confuse Lock Playhead.<commit_after>local log								= require("hs.logger").new("timline")
local inspect							= require("hs.inspect")

local just								= require("hs.just")
local axutils							= require("hs.finalcutpro.axutils")

local Playhead = {}

function Playhead.isPlayhead(element)
	return element and element:attributeValue("AXRole") == "AXValueIndicator"
end

function Playhead:new(parent)
	o = {_parent = parent}
	setmetatable(o, self)
	self.__index = self
	return o
end

function Playhead:parent()
	return self._parent
end

function Playhead:app()
	return self:parent():app()
end

-----------------------------------------------------------------------
-----------------------------------------------------------------------
--- BROWSER UI
-----------------------------------------------------------------------
-----------------------------------------------------------------------
function Playhead:UI()
	return axutils.cache(self, "_ui", function()
		local ui = self:parent():UI()
		if ui then
			return axutils.childWith(ui, "AXRole", "AXValueIndicator")
		end
		return nil
	end,
	Playhead.isPlayhead)
end

function Playhead:isShowing()
	return self:UI() ~= nil
end

function Playhead:show()
	local parent = self:parent()
	-- show the parent.
	if parent:show() then
		-- ensure the playhead is visible
		-- TODO
	end
	return self
end

function Playhead:hide()
	return self:parent():hide()
end

{'fraction_non_alphanumeric': 0.3065934065934066, 'fraction_numerical': 0.0007326007326007326, 'mean_word_length': 1.7585858585858587, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2631975', 'n_tokens_mistral': 793, 'n_tokens_neox': 735, 'n_words': 203}