Skip to content

App architecture

maculateConception edited this page Jun 20, 2021 · 8 revisions

Overview

Aural Player loosely implements the MVVM architectural pattern, although it can more accurately be described as implementing an n-tier architecture, consisting of 3 distinct tiers each with its own set of responsibilities.

App layers image

UI layer

The UI layer consists of:

  • The physical views (expressed as XIB files)
  • View controllers, view delegates / data sources, window controllers, and menu controllers
  • Custom view classes

The UI layer receives user commands such as playing a certain track or decreasing the player volume, and passes them on to the Delegate layer, described next.

Delegate layer

The Delegate layer is the middleman between the UI and the back end. It is the "brains" or logic tier of the application, responsible for such duties as:

  • Translating high-level user commands to low-level back end commands (eg. "Next chapter" to "Seek to position 2:34:55")
  • Conversion of user-friendly data values to formats required by the back end (eg. converts "25% Left" to a stereo pan value of "-0.25")
  • Initializing back end components upon app startup, based on user preferences and persisted app state (eg. populating the playlist with the same tracks from the previous app launch)

The Delegate layer consists of several classes simply named XXXDelegate, implementing protocols named XXXDelegateProtocol.

Back End

The core back end components are:

  • Audio Graph (wrapper around AVAudioEngine) - responsible for audio playback and sound manipulation (effects).
  • Player / Scheduler - responsible for track scheduling and initiation / manipulation of track playback (eg. seeking / segment looping).
  • Playlist - a data structure for maintaining the state of, and performing all functions pertaining to, the app's playlist.
Clone this wiki locally