State at end of Winter Quarter - JayThomason/Tutti GitHub Wiki

Since our software demo, we've essentially achieved an MVP-level implementation of our app between 2 phones with known IP addresses on a local WiFi network. Here's how it works right now:

Life without Tutti

On the Master phone, which is sync'd to the car playback through Bluetooth or an Aux cable...

  • The Master user enters the New Jam screen, initializing a new Jam with this user's device as the Master phone.
  • The unique ID of the Jam is displayed at the bottom of the screen. For now, this is just the IP address of the Master phone.
  • On the Master phone, a small NanoHTTPD server gets booted up in a background thread to await Join Jam requests from the other phone.

Creating and joining a Jam

Meanwhile, on the other phone (called the Client phone)...

  • The Client user enters the Join Jam screen.
  • At the same time, a local NanoHTTPD server is started on a background thread to receive future responses from the Master phone.
  • The Client phone user enters the unique Jam ID (again, the IP address of the Master phone) and presses the Join Jam button. This dispatches a request to the Master phone's server at the /joinJam API endpoint.

Sharing music library data

After hitting the Join Jam Button, the phones combine their local music collections into a shared library.

  • The Master phone's background server receives the /joinJam request, and makes a request to retrieve the Client phone's music library metadata at the client server's /getLocalLibrary endpoint.
  • The Client phone replies to the Master with a response containing the Client's local music metadata, in the form of a JSON Object.
  • The Master phone receives the JSON and parses it to add the Client music metadata to its local library.
  • After loading the Client phone's metadata, the Master phone sends an "OK" response which triggers a mutual request from the Client phone to load the Master's metadata into its local library.
  • Both Master and Client phones refresh the View displaying the music library browser.
  • Both phones can now browse the same shared library containing all the music from each device.

Both phones browsing and adding from the shared library

Now that they're browsing the same shared music library...

  • Both Master and Client can add songs from each others' phone to a shared, synchronized playlist.
  • Both Master and Client can change the currently playing song, as well as pause, restart, and skip songs.
  • No matter who takes an action, the shared Jam stays in sync and the Master phone keeps playing music.

The shared Jam stays in sync

The state of the Jam stays in sync between the phones.

  • An additional server API endpoint, /jam, is used to send messages between the phones to coordinate the state of the shared playlist:
  • /jam/add/{uniqueID}: Add the song with the given uniqueID to the Jam.
  • /jam/set/{uniqueID}: Change the currently-playing song to the song with the given uniqueID.
  • /jam/pause: Pause the currently-playing song in the Jam.
  • /jam/start: Resume playback of the Jam after making a call to /pause.
  • /jam/restart: Seek back to the beginning of the current song and replay it.

We've also continued progressing on the UI front, particularly on the music player. We designed some media player buttons to fit with our color scheme to replace the simple "Play" and "Pause" buttons used during the software demo.

We have also implemented the ability to skip songs or go backwards/restart the current song playing. The media player buttons have been added to a bottom of the screen action bar that can be viewed from the View Current Jam action. Additionally, a custom "+" button has been added to allow users to add songs. Our color scheme is black, silver, and cherry red (#FF0927).

Click next to view our future goals for this project.