\ResultController

Controller to handle result requests Generating result extracts for search results Retrieves detail information about results

Summary

Methods
Properties
Constants
getSearchResults()
getResultDetail()
postResultExtract()
_getArtist()
_getTitle()
_getFilename()
_getInstrument()
_getKey()
No public properties found
No constants found
setupLayout()
No protected properties found
N/A
generateResultExtract()
getDurationType()
No private properties found
N/A

Methods

getSearchResults()

getSearchResults() : \Illuminate\Http\RedirectResponse|\Illuminate\View\View

Function handling get route 'searchResults' ('/results')

Returns

\Illuminate\Http\RedirectResponse|\Illuminate\View\View —

Redirect to pattern input or results list

getResultDetail()

getResultDetail(integer  $id, integer  $page) : \Illuminate\View\View|\Illuminate\Http\RedirectResponse

Function handling get route 'resultDetail' ('/results/detail/{file}')

Parameters

integer $id

The upload id

integer $page

The requested page

Returns

\Illuminate\View\View|\Illuminate\Http\RedirectResponse —

A laravel view, when successful, or a redirect if fails

postResultExtract()

postResultExtract() : string

Function handling post route 'resultExtract' ('/result/extract')

Returns

string —

JSON string with the generated extract

_getArtist()

_getArtist(integer  $id) : string

Static helper function | to retrieve the artist for a given upload id

Parameters

integer $id

the uploads id

Returns

string —

The artist for given upload id

_getTitle()

_getTitle(integer  $id) : string

Static helper function to retrieve the title for a given upload id

Parameters

integer $id

the uploads id

Returns

string —

The title for given upload id

_getFilename()

_getFilename(integer  $id) : string

Static helper function to retrieve the filename for a given upload id

Parameters

integer $id

the uploads id

Returns

string —

The title for given upload id

_getInstrument()

_getInstrument(integer  $id, integer  $part_id) : string

Static helper function to retrieve the part name for a given upload id and part_id

Parameters

integer $id

the uploads id

integer $part_id

the part id

Returns

string —

The title for given upload id

_getKey()

_getKey(integer  $id) : string

Static helper function to retrieve the key for a given upload id

Parameters

integer $id

the uploads id

Returns

string —

The key for given upload id

setupLayout()

setupLayout() : void

Setup the layout used by the controller.

generateResultExtract()

generateResultExtract(integer  $upload_id, string  $part_id, integer  $voice, integer  $startMeasure, integer  $start, integer  $endMeasure, integer  $end) : \stdClass

Function to generate result extracts

Parameters

integer $upload_id

The uploads id

string $part_id

The part id

integer $voice

The voice the finding is in

integer $startMeasure

The number of the starting measure

integer $start

The note inside the starting measure

integer $endMeasure

The number of the ending measure

integer $end

The note inside the ending measure

Returns

\stdClass —

A \stdClass object containing information to render staves with vexflow

getDurationType()

getDurationType(float  $durationFloat) : string

Helper function to calculate the duration from float to type

Parameters

float $durationFloat

The duration as float

Returns

string —

The duration as string type