Skip to content

Commit

Permalink
Fixed documentation bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
latenitefilms committed Apr 9, 2021
1 parent e5cd46b commit 93145a5
Show file tree
Hide file tree
Showing 57 changed files with 1,381 additions and 554 deletions.
6 changes: 6 additions & 0 deletions src/extensions/cp/apple/finalcutpro/export/ExportDialog.lua
Expand Up @@ -37,6 +37,12 @@ end
--- cp.apple.finalcutpro.export.ExportDialogTitleText(parent)
--- Constructor
--- Creates a new Export [Dialog](cp.ui.Dialog.md)
---
--- Parameters:
--- * None
---
--- Returns:
--- * None
function ExportDialog:initialize(parent)
Dialog.initialize(self, parent, parent.windowsUI:mutate(function(original)
return cache(self, "_window", function()
Expand Down
11 changes: 7 additions & 4 deletions src/extensions/cp/apple/finalcutpro/inspector/BasePanel.lua
Expand Up @@ -18,11 +18,11 @@ local BasePanel = Element:subclass("cp.apple.finalcutpro.inspector.BasePanel")
--- Constructs the panel, initialising the parent and the [UI](cp.ui.Element.md#UI).
---
--- Parameters:
--- * parent - The parent [Element](cp.ui.Element.md).
--- * panelType - The panel type string, as defined in [Inspector.INSPECTOR_TABS](cp.apple.finalcutpro.inspector.Inspector.md#INSPECTOR_TABS).
--- * parent - The parent [Element](cp.ui.Element.md).
--- * panelType - The panel type string, as defined in [Inspector.INSPECTOR_TABS](cp.apple.finalcutpro.inspector.Inspector.md#INSPECTOR_TABS).
---
--- Returns:
--- * The new `BasePanel` instance.
--- * The new `BasePanel` instance.
function BasePanel:initialize(parent, panelType)
local UI = parent.panelUI:mutate(function(original)
return cache(self, "_ui",
Expand All @@ -42,8 +42,11 @@ end
--- Method
--- Gets the type of panel this is.
---
--- Parameters:
--- * None
---
--- Returns:
--- * The panel type identifier.
--- * The panel type identifier.
function BasePanel:panelType()
return self._panelType
end
Expand Down
20 changes: 13 additions & 7 deletions src/extensions/cp/apple/finalcutpro/inspector/Inspector.lua
Expand Up @@ -269,8 +269,11 @@ end
--- Method
--- A [Statement](cp.rx.go.Statement.md) that attempts to show the `Inspector`.
---
--- Parameters:
--- * None
---
--- Returns:
--- * The `Statement`, resolving to `true` if the Inspector was shown successfully, or an error if not.
--- * The `Statement`, resolving to `true` if the Inspector was shown successfully, or an error if not.
function Inspector.lazy.method:doShow()
return If(self.isShowing):Is(false)
:Then(self:parent():doShow())
Expand Down Expand Up @@ -302,8 +305,11 @@ end
--- Method
--- A [Statement](cp.rx.go.Statement.md) that attempts to hide the `Inspector`.
---
--- Parameters:
--- * None
---
--- Returns:
--- * The `Statement`, resolving to `true` if the Inspector was hidden successfully, or an error if not.
--- * The `Statement`, resolving to `true` if the Inspector was hidden successfully, or an error if not.
function Inspector.lazy.method:doHide()
return If(self.isShowing):Is(true)
:Then(self:app().menu:doSelectMenu({"Window", "Show in Workspace", "Inspector"}))
Expand Down Expand Up @@ -366,10 +372,10 @@ end
--- Finds the named Inspector tab button, or sends an error if the type is unsupported.
---
--- Parameters:
--- * type - the type of the button to return. (e.g. "Video")
--- * type - the type of the button to return. (e.g. "Video")
---
--- Returns:
--- * A [Statement](cp.rx.go.Statement.md) to execute.
--- * A [Statement](cp.rx.go.Statement.md) to execute.
---
--- Notes:
--- * Valid strings for `type` are as follows:
Expand All @@ -383,7 +389,7 @@ end
--- * Title
--- * Transition
--- * Video
--- * Not all button types are available in all contexts.
--- * Not all button types are available in all contexts.
function Inspector:doFindTabButton(type)
local code = Inspector.INSPECTOR_TABS[type]
if not code then
Expand All @@ -406,10 +412,10 @@ end
--- A Statement that selects the specified tab title.
---
--- Parameters:
--- * title - The title of the tab to select.
--- * title - The title of the tab to select.
---
--- Returns:
--- * The [Statement](cp.rx.go.Statement.md)
--- * The [Statement](cp.rx.go.Statement.md)
function Inspector:doSelectTab(title)
return Do(self:doShow())
:Then(
Expand Down
Expand Up @@ -150,6 +150,9 @@ end
--- Method
--- Shows the `ColorWheel`, if possible.
---
--- Parameters:
--- * None
---
--- Returns:
--- * The same `ColorWheel` instance, for chaining.
function ColorWheel:show()
Expand All @@ -166,6 +169,9 @@ end
--- Method
--- A [Statement](cp.rx.go.Statement.md) that attempts to show the `ColorWheel`.
---
--- Parameters:
--- * None
---
--- Returns:
--- * The `Statement`, resolving to `true` if shown, `false` if not.
function ColorWheel.lazy.method:doShow()
Expand Down Expand Up @@ -198,6 +204,9 @@ end
--- Method
--- A [Statement](cp.rx.go.Statement.md) that attempts to select this `ColorWheel`.
---
--- Parameters:
--- * None
---
--- Returns:
--- * The `Statement`, resolving to `true` if selected, otherwise `false`.
function ColorWheel.lazy.method:doSelect()
Expand Down
Expand Up @@ -20,10 +20,10 @@ local BackgroundTasksDialog = Dialog:subclass("cp.apple.finalcutpro.main.Backgro
--- Checks if the element is an `BackgroundTasksDialog` instance.
---
--- Parameters:
--- * element - The `axuielement` to check.
--- * element - The `axuielement` to check.
---
--- Returns:
--- * `true` if it matches the pattern for a `BackgroundTasksDialog``.
--- * `true` if it matches the pattern for a `BackgroundTasksDialog``.
function BackgroundTasksDialog.static.matches(element)
if Dialog.matches(element) and #element == 6 then
local backgroundTasksString = strings:find("FFTranscodeMissingOpticalFlowMessageText")
Expand All @@ -38,6 +38,12 @@ end
--- cp.apple.finalcutpro.main.BackgroundTasksDialog(cpApp)
--- Constructor
--- Creates a new Background Tasks [Dialog](cp.ui.Dialog.md)
---
--- Parameters:
--- * None
---
--- Returns:
--- * None
function BackgroundTasksDialog:initialize(cpApp)
Dialog.initialize(self, cpApp, cpApp.UI:mutate(function(original)
return cache(self, "_window", function()
Expand Down
Expand Up @@ -37,6 +37,12 @@ end
--- cp.apple.finalcutpro.main.FindAndReplaceTitleText(cpApp, upProp)
--- Constructor
--- Creates a new "Find and Replace Title Text" [Dialog](cp.ui.Dialog.md)
---
--- Parameters:
--- * cpApp - The cpApp
---
--- Returns:
--- * None
function FindAndReplace:initialize(cpApp)
Dialog.initialize(self, cpApp, cpApp.UI:mutate(function(original)
return cache(self, "_window", function()
Expand Down Expand Up @@ -169,6 +175,12 @@ end
--- cp.apple.finalcutpro.main.FindAndReplaceTitleText:doShow() -> cp.rx.go.Statement
--- Method
--- A [Statement](cp.rx.go.Statement.md) that will attempt to show the "Find And Replace Title Text" dialog.
---
--- Parameters:
--- * None
---
--- Returns:
--- * None
function FindAndReplace.lazy.method:doShow()
return If(self.isShowing):Is(false)
:Then(self:app():doLaunch())
Expand All @@ -181,6 +193,12 @@ end
--- cp.apple.finalcutpro.main.FindAndReplaceTitleText:doHide() -> cp.rx.go.Statement
--- Method
--- A [Statement](cp.rx.go.Statement.md) that will attempt to hide the "Find And Replace Title Text" dialog.
---
--- Parameters:
--- * None
---
--- Returns:
--- * None
function FindAndReplace.lazy.method:doHide()
return If(self.isShowing)
:Then(self:doClose())
Expand Down Expand Up @@ -232,6 +250,12 @@ end
--- cp.apple.finalcutpro.main.FindAndReplaceTitleText:doFindAndReplaceAll(find, replace) -> cp.rx.go.Statement
--- Method
--- A [Statement](cp.rx.go.Statement.md) that will attempt to find all titles containing `find` and replace them with `replace`.
---
--- Parameters:
--- * None
---
--- Returns:
--- * None
function FindAndReplace:doFindAndReplaceAll(find, replace)
return Do(self:app():doLaunch())
:Then(
Expand Down
12 changes: 12 additions & 0 deletions src/extensions/cp/apple/finalcutpro/main/LibrariesBrowser.lua
Expand Up @@ -258,6 +258,12 @@ end
--- cp.apple.finalcutpro.main.Browser.appearanceAndFiltering <cp.apple.finalcutpro.main.AppearanceAndFiltering>
--- Method
--- The Clip [AppearanceAndFiltering](cp.apple.finalcutpro.main.AppearanceAndFiltering.md) Menu Popover
---
--- Parameters:
--- * None
---
--- Returns:
--- * None
function LibrariesBrowser.lazy.value:appearanceAndFiltering()
return AppearanceAndFiltering(self)
end
Expand All @@ -279,6 +285,12 @@ end
--- cp.apple.finalcutpro.main.LibrariesBrowser.sidebar <cp.apple.finalcutpro.main.LibrariesSidebar>
--- Method
--- The [LibrariesSidebar](cp.apple.finalcutpro.main.LibrariesSidebar.md) Table
---
--- Parameters:
--- * None
---
--- Returns:
--- * None
function LibrariesBrowser.lazy.value:sidebar()
return LibrariesSidebar(self)
end
Expand Down
12 changes: 12 additions & 0 deletions src/extensions/cp/apple/finalcutpro/prefs/ImportPanel.lua
Expand Up @@ -61,6 +61,12 @@ end
--- cp.apple.finalcutpro.prefs.ImportPanel:toggleMediaLocation() -> boolean
--- Method
--- Toggles between the "Copy to library storage location" and "Leave files in place" options.
---
--- Parameters:
--- * None
---
--- Returns:
--- * None
function ImportPanel:toggleMediaLocation()
if self:show():isShowing() then
if self:copyToLibraryStorageLocation():checked() then
Expand All @@ -76,6 +82,12 @@ end
--- cp.apple.finalcutpro.prefs.ImportPanel:toggleMediaLocation() -> cp.rx.go.Statement
--- Method
--- A `Statement` that toggles between the "Copy to library storage location" and "Leave files in place" options.
---
--- Parameters:
--- * None
---
--- Returns:
--- * None
function ImportPanel.lazy.method:doToggleMediaLocation()
return Do(self:doShow())
:Then(
Expand Down
30 changes: 30 additions & 0 deletions src/extensions/cp/apple/finalcutpro/timeline/AudioRole.lua
Expand Up @@ -20,6 +20,12 @@ local AudioRole = Role:subclass("cp.apple.finalcutpro.timeline.AudioRole")
--- cp.apple.finalcutpro.timeline.AudioRole.matches(element) -> boolean
--- Function
--- Checks if the element is a "Audio" Role.
---
--- Parameters:
--- * element - An element to check
---
--- Returns:
--- * A boolean
function AudioRole.static.matches(element)
return Role.matches(element)
and valueOf(element, "AXDisclosureLevel") == 0
Expand Down Expand Up @@ -73,27 +79,51 @@ end
--- cp.apple.finalcutpro.timeline.AudioRole:doFocusInTimeline() -> cp.rx.go.Statement
--- Method
--- A [Statement](cp.rx.go.Statement.md) that will attempt to focus on this audio role in the timeline.
---
--- Parameters:
--- * None
---
--- Returns:
--- * A Statement
function AudioRole.lazy.method:doFocusInTimeline()
return self.focusedInTimeline:doCheck()
end

--- cp.apple.finalcutpro.timeline.AudioRole:doUnfocusInTimeline() -> cp.rx.go.Statement
--- Method
--- A [Statement](cp.rx.go.Statement.md) that will attempt to unfocus on this audio role in the timeline.
---
--- Parameters:
--- * None
---
--- Returns:
--- * A Statement
function AudioRole.lazy.method:doUnfocusInTimeline()
return self.focusedInTimeline:doUncheck()
end

--- cp.apple.finalcutpro.timeline.AudioRole:doShowSubroleLanes() -> cp.rx.go.Statement
--- Method
--- A [Statement](cp.rx.go.Statement.md) that will attempt to show the subrole lanes on this audio role in the timeline.
---
--- Parameters:
--- * None
---
--- Returns:
--- * A Statement
function AudioRole.lazy.method:doShowSubroleLanes()
return self.subroleLanes:doCheck()
end

--- cp.apple.finalcutpro.timeline.AudioRole:doHideSubroleLanes() -> cp.rx.go.Statement
--- Method
--- A [Statement](cp.rx.go.Statement.md) that will attempt to hide the subrole lanes on this audio role in the timeline.
---
--- Parameters:
--- * None
---
--- Returns:
--- * A Statement
function AudioRole.lazy.method:doHideSubroleLanes()
return self.subroleLanes:doUncheck()
end
Expand Down
12 changes: 9 additions & 3 deletions src/extensions/cp/apple/finalcutpro/timeline/AudioSubrole.lua
Expand Up @@ -12,6 +12,12 @@ local AudioSubrole = Role:subclass("cp.apple.finalcutpro.timeline.AudioSubrole")
--- cp.apple.finalcutpro.timeline.AudioSubrole.matches(element) -> boolean
--- Function
--- Checks if the element is a "Audio" Subrole.
---
--- Parameters:
--- * element - An element to check
---
--- Returns:
--- * A boolean
function AudioSubrole.static.matches(element)
return Role.matches(element)
and AudioRole.matches(element:attributeValue("AXDisclosedByRow"))
Expand All @@ -22,11 +28,11 @@ end
--- Creates a new instance with the specified `parent` and `uiFinder`.
---
--- Parameters:
--- * parent - the parent `Element`.
--- * uiFinder - a `function` or `cp.prop` containing the `axuielement`
--- * parent - the parent `Element`.
--- * uiFinder - a `function` or `cp.prop` containing the `axuielement`
---
--- Returns:
--- * The new `Row`.
--- * The new `Row`.
function AudioSubrole:initialize(parent, uiFinder)
Role.initialize(self, parent, uiFinder, Role.TYPE.AUDIO)
end
Expand Down
6 changes: 6 additions & 0 deletions src/extensions/cp/apple/finalcutpro/timeline/CaptionsRole.lua
Expand Up @@ -21,6 +21,12 @@ local CaptionsRole = Role:subclass("cp.apple.finalcutpro.timeline.CaptionsRole")
--- cp.apple.finalcutpro.timeline.CaptionsRole.matches(element) -> boolean
--- Function
--- Checks if the element is a "Captions" Role.
---
--- Parameters:
--- * element - The element to check
---
--- Returns:
--- * A boolean
function CaptionsRole.static.matches(element)
return Role.matches(element)
and valueOf(element, "AXDisclosureLevel") == 0
Expand Down
12 changes: 9 additions & 3 deletions src/extensions/cp/apple/finalcutpro/timeline/CaptionsSubrole.lua
Expand Up @@ -16,6 +16,12 @@ local CaptionsSubrole = Role:subclass("cp.apple.finalcutpro.timeline.CaptionsSub
--- cp.apple.finalcutpro.timeline.CaptionsSubrole.matches(element) -> boolean
--- Function
--- Checks if the element is a "Captions" Subrole.
---
--- Parameters:
--- * element - An element to check
---
--- Returns:
--- * A boolean
function CaptionsSubrole.static.matches(element)
return Role.matches(element)
and CaptionsRole.matches(element:attributeValue("AXDisclosedByRow"))
Expand All @@ -26,11 +32,11 @@ end
--- Creates a new instance with the specified `parent` and `uiFinder`.
---
--- Parameters:
--- * parent - the parent `Element`.
--- * uiFinder - a `function` or `cp.prop` containing the `axuielement`
--- * parent - the parent `Element`.
--- * uiFinder - a `function` or `cp.prop` containing the `axuielement`
---
--- Returns:
--- * The new `Row`.
--- * The new `Row`.
function CaptionsSubrole:initialize(parent, uiFinder)
Role.initialize(self, parent, uiFinder, Role.TYPE.CAPTION)
end
Expand Down

0 comments on commit 93145a5

Please sign in to comment.