CatNiP docutest
Sähköinen nuottikirja, HY-TKTKL-OHTUPROJ KESÄ11
|
#import <CatNiPViewController.h>
Public Member Functions | |
(NSInteger) | - arrayToSearch:textToSearch: |
very lazy search from arrayToSearch with given textToSearch. | |
(NSInteger) | - compositionDatasToSearch:textToSearch: |
(void) | - dealloc [implementation] |
(void) | - didReceiveMemoryWarning [implementation] |
(void) | - didRotateFromInterfaceOrientation: [implementation] |
(void) | - dismissPlaylistPopover |
Dismiss the playlistPopover. | |
(void) | - dismissScorePopover |
Dismiss the scorePopover. | |
(IBAction) | - fitToWidth: |
(void) | - hideToolbarWithAnimation |
hide toolbar with animation | |
(void) | - hideViewWithAnimation: |
show any view with animation | |
(void) | - imslpComposersReport: [implementation] |
Target method for IMSLPQueryHelper, receives reports on composer list progress. | |
(void) | - imslpCompositionsReport: [implementation] |
Target method for IMSLPQueryHelper, receives reports on composition list progress. | |
(void) | - imslpPageReport: [implementation] |
(void) | - libraryTypeChanged: [implementation] |
Target method for segmented control libraryType. | |
(void) | - openDetailPopoverFromRect:inView:withScore:ofComposer:andComposition: |
Opens popover with information from given ScoreData object. | |
(void) | - openPlaylistPopover: |
Open playlist popover with all playlists as cells. | |
(void) | - openScorePopover:editable: |
Open ScorePopoverController's view in UIPopoverController. | |
(BOOL) | - openScoreSheet: |
Work method for "opening" a pdf file, needed since navigating a playlist needs to display PDFs too. | |
(void) | - playlistNavigatorChanged: [implementation] |
Target method for playlist navigation (previous score, next score) button clicks. | |
(void) | - processError: [implementation] |
CatNiPErrorConsumer protocol implementation. | |
(void) | - saveAndShowScore:: [implementation] |
Save and show score described in parameters as LocalScoreData object and add it to allLocalScores array in LocalDelegateDataSource. | |
(void) | - saveScore:: [implementation] |
Save score described in parameters as LocalScoreData object and add it to allLocalScores array in LocalDelegateDataSource. | |
(void) | - scoreView_tapped: |
Master method for recognizing tapping gestures in scoresView. | |
(void) | - searchBar:textDidChange: |
UISearchBarDelegate protocol function's implementation. | |
(void) | - searchBarSearchButtonClicked: |
UISearchBarDelegate protocol function's implementation. | |
(void) | - setCurrentPlaylist: [implementation] |
Custom accessor method for the current playlist property. | |
(BOOL) | - shouldAutorotateToInterfaceOrientation: [implementation] |
(IBAction) | - showHideLibrary: |
Hide and show sheet search UI elements. | |
(IBAction) | - showHideNotes: |
Shows and hides the notes popover. | |
(void) | - showScoreSheets: |
Method for loading sheets defined in filepath. | |
(void) | - showToolbarWithAnimation |
show toolbar with animation | |
(void) | - showViewWithAnimation: |
show any view with animation | |
(UITableViewCell *) | - tableView:createCellWithIdentifier: |
Create standard cell for application. | |
(void) | - viewDidLoad [implementation] |
(void) | - viewDidUnload [implementation] |
Protected Attributes | |
Playlist * | _currentPlaylist |
CompositionData * | _readComposition |
UIPopoverController * | detailPop |
DetailPopoverController * | dpc |
Playlist * | dummyPlaylist |
UIBarButtonItem * | fitToWidthButton |
IMSLPDelegateDataSource * | IMSLPdds |
UIActivityIndicatorView * | libraryActivityIndicatorLeft |
UIBarButtonItem * | libraryButton |
UISearchBar * | librarySearchbarLeft |
UISearchBar * | librarySearchbarRight |
UITableView * | libraryTableViewLeft |
UITableView * | libraryTableViewRight |
UISegmentedControl * | libraryType |
UIView * | libraryViewLeft |
UIView * | libraryViewRight |
LocalDelegateDataSource * | LOCALdds |
UIBarButtonItem * | notesButton |
UIPopoverController * | notesPop |
UITextView * | notesTextView |
NotesPopoverController * | npc |
UIPopoverController * | playlistPop |
PlaylistsDelegateDataSource * | PLAYLISTSdds |
PlaylistPopoverController * | ppc |
UIPopoverController * | scorePop |
UIScoreView * | scoreView |
UISegmentedControl * | searchType |
ScorePopoverController * | spc |
UIToolbar * | toolbar |
UIView * | toolbarView |
Properties | |
NSString * | currentlyOpenedFile |
Playlist * | currentPlaylist |
Custom accessor method for the current playlist property. | |
NSInteger | currentPlaylistIndex |
LocalScoreData * | currentScore |
UIFont * | defaultFont |
IBOutlet DetailPopoverController * | dpc |
IBOutlet UIBarButtonItem * | fitToWidthButton |
IMSLPDelegateDataSource * | imslpDelegateAndDataSource |
IBOutlet UIActivityIndicatorView * | libraryActivityIndicatorLeft |
IBOutlet UIBarButtonItem * | libraryButton |
IBOutlet UISearchBar * | librarySearchbarLeft |
IBOutlet UISearchBar * | librarySearchbarRight |
IBOutlet UITableView * | libraryTableViewLeft |
IBOutlet UITableView * | libraryTableViewRight |
IBOutlet UISegmentedControl * | libraryType |
IBOutlet UIView * | libraryViewLeft |
IBOutlet UIView * | libraryViewRight |
LocalDelegateDataSource * | localDelegateAndDataSource |
IBOutlet UIBarButtonItem * | notesButton |
IBOutlet NotesPopoverController * | npc |
IBOutlet UIBarButtonItem * | playlistNavigateButton |
IBOutlet UISegmentedControl * | playlistNavigateSControl |
PlaylistsDelegateDataSource * | playlistsDelegateAndDataSource |
IBOutlet PlaylistPopoverController * | ppc |
IBOutlet UIScoreView * | scoreView |
IBOutlet UISegmentedControl * | searchType |
IBOutlet ScorePopoverController * | spc |
IBOutlet UIToolbar * | toolbar |
IBOutlet UIView * | toolbarView |
- (NSInteger) arrayToSearch: | (NSArray *) | array | |
textToSearch: | (NSString *) | text | |
very lazy search from arrayToSearch with given textToSearch.
Searches arrayToSearch for textToSearch by comparing each index in arrayToSearch with textToSearch. If exact match is found returns that index else if arrayToSearch's string is compared to be later than textToSearch will return that index. Otherwise will return 0 (ie. all arrayToSearch's strings are compared to be before textToSearch.)
arrayToSearch | searches the array with the given text |
textToSearch | given text that is searched from the array |
- (NSInteger) compositionDatasToSearch: | (NSArray *) | array | |
textToSearch: | (NSString *) | text | |
- (void) dealloc | [implementation] |
- (void) didReceiveMemoryWarning | [implementation] |
- (void) didRotateFromInterfaceOrientation: | (UIInterfaceOrientation) | fromInterfaceOrientation | [implementation] |
- (void) dismissPlaylistPopover |
Dismiss the playlistPopover.
- (void) dismissScorePopover |
Dismiss the scorePopover.
- (IBAction) fitToWidth: | (id) | sender |
- (void) hideToolbarWithAnimation |
hide toolbar with animation
- (void) hideViewWithAnimation: | (UIView *) | view |
show any view with animation
- (void) imslpComposersReport: | (id) | progress | [implementation] |
Target method for IMSLPQueryHelper, receives reports on composer list progress.
Sets IMSLPDelegateDataSource's composers array to progress array. If LIBRARYTYPE == IMSLP shows that array.
imslpComposersReport | Array of composer names |
- (void) imslpCompositionsReport: | (id) | progress | [implementation] |
Target method for IMSLPQueryHelper, receives reports on composition list progress.
Removes all objects from IMSLPdds.compositions array and adds all objets from progress array to it. Sort IMSLPdds.compositions array afterwards and reloads libraryTableViewRight's data.
- (void) imslpPageReport: | (id) | pageData | [implementation] |
- (void) libraryTypeChanged: | (id) | sender | [implementation] |
Target method for segmented control libraryType.
Tracks which library type is currently selected and changes libraryTableViewLeft's and libraryTableViewRight's delegate and datasource to match current selection. Removes all objects from libraryDataTableLeft and libraryDataTableRight, hides current popovers and libraryViewRight before calling appropriate library delegate and datasource class' changeLibraryTypeTo function.
sender | id of the sender. Used only by libraryType when selected segment changes. |
- (void) openDetailPopoverFromRect: | (CGRect) | rect | |
inView: | (UIView *) | view | |
withScore: | (ScoreData *) | score | |
ofComposer: | (NSString *) | composer | |
andComposition: | (NSString *) | composition | |
Opens popover with information from given ScoreData object.
rect | rectangle from which the popover is represented (arrow is shown in here) |
view | view in which the rectangle is |
withScore | ScoreData object which popover shows |
ofComposer | composer of the score |
andComposition | composition of the score |
- (void) openPlaylistPopover: | (LocalScoreData *) | score |
Open playlist popover with all playlists as cells.
- (void) openScorePopover: | (CompositionData *) | scores | |
editable: | (BOOL) | ed | |
Open ScorePopoverController's view in UIPopoverController.
Initializes ScorePopoverController with data about selected composition's scores loaded from either local or IMSLP's library (depending on current delegate and datasource). Popover is sized to 500 x 400 pixels and the arrow points to the cell which opened the popover. Default arrow direction is right. Check ScorePopOverController for details about it's contents.
openScorePopover | CompositionData which scores are shown in popover |
editable | sets popover's scoreTableView to represents value of the parameter |
- (BOOL) openScoreSheet: | (LocalScoreData *) | score |
Work method for "opening" a pdf file, needed since navigating a playlist needs to display PDFs too.
- (void) playlistNavigatorChanged: | (id) | control | [implementation] |
Target method for playlist navigation (previous score, next score) button clicks.
Reads the next/previous Score in the current playlist and sets it as the current score. Does nothing if no playlist is set or if we're at the end of the playlist and next is pressed or if we're at the beginning of the playlist and previous is pressed.
control | The UISegmentedControl that generated the event |
- (void) processError: | (NSError *) | error | [implementation] |
CatNiPErrorConsumer protocol implementation.
Receives errors reported to CatNiPErrorManager.
The | reported error to be processed/shown to the user. |
Reimplemented from <CatNiPErrorConsumer>.
- (void) saveAndShowScore: | (id) | fileNameParams | |
: | (id) | ofComposition | |
[implementation] |
Save and show score described in parameters as LocalScoreData object and add it to allLocalScores array in LocalDelegateDataSource.
Called after pdf-file has been downloaded from IMSLP.
Saves allLocalScores to default filepath afterwards.
pdf-filename | (index:0) and full pdf-filepath with filename (index:1) |
CompositionData | object from where the score is searched with pdf-filename |
- (void) saveScore: | (id) | fileNameParams | |
: | (id) | ofComposition | |
[implementation] |
Save score described in parameters as LocalScoreData object and add it to allLocalScores array in LocalDelegateDataSource.
Called after pdf-file has been downloaded from IMSLP.
Saves allLocalScores to default filepath afterwards.
pdf-filename | (index:0) and full pdf-filepath with filename (index:1) |
CompositionData | object from where the score is searched with pdf-filename |
- (void) scoreView_tapped: | (UIGestureRecognizer *) | recognizer |
Master method for recognizing tapping gestures in scoresView.
If toolbar is shown will hide all UI elements. Otherwise will show toolbar.
scoreView_tapped | UIGestureRecognizer that sends the message |
- (void) searchBar: | (UISearchBar *) | searchBar | |
textDidChange: | (NSString *) | searchText | |
UISearchBarDelegate protocol function's implementation.
Searches from either composers (left library table) or compositions (right library table) depending on which of them is selected.
Not supported atm. because of performance issues. ie. in long tables every letter takes about half a second or longer to be searched and makes longer search strings pain to write.
searchBar | either left (composers) or right (compositions) |
textDidChange | search text that was written |
- (void) searchBarSearchButtonClicked: | (UISearchBar *) | searchBar |
UISearchBarDelegate protocol function's implementation.
Basic search behaviour for both librarySearchL and librarySearchR. Searches arrays in currently active delegate for matches with arrayToSearh:textToSearch or CompositionDataToSearh:textToSearch functions. Playlist searchs are not implemented yet.
searchBarSearchButtonClicked | librarySearchL or librarySearchR |
- (void) setCurrentPlaylist: | (Playlist *) | currentPlaylist | [implementation] |
Custom accessor method for the current playlist property.
Sets the current playlist property. If the property is not-nil and the playlist contains scores, opens the first score in the playlist and sets the current score index to the beginning of the playlist.
currentPlaylist | The playlist to display or nil to stop playlist navigation functionality |
- (BOOL) shouldAutorotateToInterfaceOrientation: | (UIInterfaceOrientation) | interfaceOrientation | [implementation] |
- (IBAction) showHideLibrary: | (id) | sender |
Hide and show sheet search UI elements.
This function dismisses notesPop, hides all library search elements if libraryTableViewLeft is shown. Otherwise it shows libraryType, libraryViewLeft and reloads libraryTableViewLeft's data.
showHideLibrary | hides and shows sender's search UI elements |
- (IBAction) showHideNotes: | (id) | sender |
Shows and hides the notes popover.
sender | The element that sent the action, ideally _notesButton. |
- (void) showScoreSheets: | (LocalScoreData *) | score |
Method for loading sheets defined in filepath.
Should hide all UI elements after loading and shows new sheets in scoreView.
showScoreSheets | shows score sheets from the filepath |
- (void) showToolbarWithAnimation |
show toolbar with animation
- (void) showViewWithAnimation: | (UIView *) | view |
show any view with animation
- (UITableViewCell *) tableView: | (UITableView *) | tableView | |
createCellWithIdentifier: | (NSString *) | identifier | |
Create standard cell for application.
No accessoryview or imageview defined.
standard "look" is defined by: cell.textLabel.lineBreakMode = UILineBreakModeWordWrap cell.textLabel.numberOfLines = 0 cell.textLabel.font = defaultFont cell.selectionStyle = UITableViewCellSelectionStyleGray
tableView | tableView for which cell is created |
createCellWithIdentifier | identifier for cell. Used to dequeue reusable cells from tableview. |
- (void) viewDidLoad | [implementation] |
- (void) viewDidUnload | [implementation] |
- (Playlist*) _currentPlaylist [protected] |
- (CompositionData*) _readComposition [protected] |
- (UIPopoverController*) detailPop [protected] |
- (DetailPopoverController*) dpc [protected] |
- (Playlist*) dummyPlaylist [protected] |
- (UIBarButtonItem*) fitToWidthButton [protected] |
- (IMSLPDelegateDataSource*) IMSLPdds [protected] |
- (UIActivityIndicatorView*) libraryActivityIndicatorLeft [protected] |
- (UIBarButtonItem*) libraryButton [protected] |
- (UISearchBar*) librarySearchbarLeft [protected] |
- (UISearchBar*) librarySearchbarRight [protected] |
- (UITableView*) libraryTableViewLeft [protected] |
- (UITableView*) libraryTableViewRight [protected] |
- (UISegmentedControl*) libraryType [protected] |
- (UIView*) libraryViewLeft [protected] |
- (UIView*) libraryViewRight [protected] |
- (LocalDelegateDataSource*) LOCALdds [protected] |
- (UIBarButtonItem*) notesButton [protected] |
- (UIPopoverController*) notesPop [protected] |
- (UITextView*) notesTextView [protected] |
- (NotesPopoverController*) npc [protected] |
- (UIPopoverController*) playlistPop [protected] |
- (PlaylistsDelegateDataSource*) PLAYLISTSdds [protected] |
- (PlaylistPopoverController*) ppc [protected] |
- (UIPopoverController*) scorePop [protected] |
- (UIScoreView*) scoreView [protected] |
- (UISegmentedControl*) searchType [protected] |
- (ScorePopoverController*) spc [protected] |
- (UIToolbar*) toolbar [protected] |
- (UIView*) toolbarView [protected] |
- (NSString*) currentlyOpenedFile [read, write, copy] |
- (Playlist *) currentPlaylist [read, write, retain] |
Custom accessor method for the current playlist property.
- (NSInteger) currentPlaylistIndex [read, write, assign] |
- (LocalScoreData *) currentScore [read, write, retain] |
- (UIFont *) defaultFont [read, write, retain] |
- (IBOutlet DetailPopoverController*) dpc [read, write, retain] |
- (IBOutlet UIBarButtonItem*) fitToWidthButton [read, write, retain] |
- (IMSLPDelegateDataSource*) imslpDelegateAndDataSource [read, write, retain] |
- (IBOutlet UIActivityIndicatorView*) libraryActivityIndicatorLeft [read, write, retain] |
- (IBOutlet UIBarButtonItem*) libraryButton [read, write, retain] |
- (IBOutlet UISearchBar*) librarySearchbarLeft [read, write, retain] |
- (IBOutlet UISearchBar*) librarySearchbarRight [read, write, retain] |
- (IBOutlet UITableView*) libraryTableViewLeft [read, write, retain] |
- (IBOutlet UITableView*) libraryTableViewRight [read, write, retain] |
- (IBOutlet UISegmentedControl*) libraryType [read, write, retain] |
- (IBOutlet UIView*) libraryViewLeft [read, write, retain] |
- (IBOutlet UIView*) libraryViewRight [read, write, retain] |
- (LocalDelegateDataSource*) localDelegateAndDataSource [read, write, retain] |
- (IBOutlet UIBarButtonItem*) notesButton [read, write, retain] |
- (IBOutlet NotesPopoverController*) npc [read, write, retain] |
- (IBOutlet UIBarButtonItem*) playlistNavigateButton [read, write, retain] |
- (IBOutlet UISegmentedControl*) playlistNavigateSControl [read, write, retain] |
- (PlaylistsDelegateDataSource*) playlistsDelegateAndDataSource [read, write, retain] |
- (IBOutlet PlaylistPopoverController*) ppc [read, write, retain] |
- (IBOutlet UIScoreView*) scoreView [read, write, retain] |
- (IBOutlet UISegmentedControl*) searchType [read, write, retain] |
- (IBOutlet ScorePopoverController*) spc [read, write, retain] |
- (IBOutlet UIToolbar*) toolbar [read, write, retain] |
- (IBOutlet UIView*) toolbarView [read, write, retain] |