Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Phone

Programming Windows Phone 7 : Pivot and Panorama - Music by Composer

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
5/22/2011 4:51:41 PM
Once I started thinking about it, I realized that the Pivot control was the perfect choice for realizing a program I had long been contemplating. This program corrects what I perceive to be a major deficiency of portable music players such as the Zune and Windows Phone 7, so a little explanation is necessary:

As you may know, the landscape of music in the United States and Europe can be roughly divided into performer-centric music and composer-centric music. The performer-centric tradition has close ties with the rise and evolution of recording technologies and encompasses performers from (say) Robert Johnson (1911–1938) through Lady Gaga (b. 1986). Performer-centric music consists predominantly of a musical form known as the song, generally several minutes in length, with a vocalist and instrumental accompaniment.

The composer-centric tradition is much older, stretching from (say) Claudio Monteverdi (1567–1643) through Jennifer Higdon (b. 1962), and encompasses very many different forms (for example, string quartet, piano concerto, symphony, and opera as well as songs) of widely varying lengths, styles, and instrumentation.

People who listen to composer-centric music generally prefer to organize their music by composer, and then within composer by composition, and within composition by performer. (As with the performer-centric tradition, the word artist is satisfactory for referring to the person or people playing the music.) The Zune desktop software allows you to enter composer information when downloading music and ripping CDs, but that information is not transferred with the files to portable devices such as the phone. Even if composer information was included in the music files transferred to the phone, it is not available through the public properties of the classes used to access the music.

To compensate for this deficiency, people who listen to composer-centric music often incorporate the composer’s name in the album title followed by a colon, such as:

Mahler: Symphony No. 2

Many CDs of music in the composer-centric tradition rip with album titles in this format. For albums that have music of more than one composer, I’ve also adopted the convention of separating the composers’ names with commas:

Adès, Schubert: Piano Quintets

Over the years I’ve ripped about 600 of my CDs to the PC, and most of them are identified in this way. When the music player lists the albums alphabetically by album title, the music is also listed alphabetically by composer, so that’s a big help.

But I wanted more. I wanted a hierarchical structure based around the composer. I wanted to see the composers’ names up front so I begin by selecting Schubert or Debussy or Messiaen.

So I decided to write a Windows Phone 7 program called MusicByComposer that takes this extra step. The program accesses the music library on the phone and—under the assumption that the album titles begin with one or more composer names followed by a colon—extracts the composers’ names from the album titles. It then arranges the music by composer, where each composer becomes a PivotItem. The content of that PivotItem is a ListBox that lists all the albums containing music by that composer.

The MusicByComposer program begins with a screen that looks something like this:



You should recognize this as a standard Pivot control where each PivotItem is a composer. On my phone the first PivotItem displays albums by American composer John Adams (b. 1947). The other PivotItem headers you can see here are for British composer Thomas Adès (b. 1971) and German composer Johann Sebastian Bach (1685–1750).

If none of your music has a colon in the album title, all your albums will be listed under a single PivotItem with the header “Other”.

The PivotItem for each composer contains a ListBox where each item includes the thumbnail album art, the album title (without the composer name) using the phone’s current accent color, and the artist associated with the album in the foreground color.

Tapping any album brings you to a page for that album:



This is a standard PhoneApplicationPage with the standard two TextBlock items for the application title and the page title, but as you can see, the titles are the same size and in the same position as the Pivot control on the opening page. The larger album art is shown with the full album name and artist. Underneath is a ScrollViewer with an ItemsControl with all the tracks from the album. This screen has no touch interface except for scrolling: You control everything with the ApplicationBar buttons: go to the previous track, play and pause, and go to the next track. The currently playing track is indicated with the accent color and time progress.

After an application starts playing an album, it’s normal in Windows Phone 7 for the album to play all the way through, even if the application ends or the phone’s display shuts off. The MusicByComposer program allows you to navigate to other albums, but it will only shut off an existing album and play a new one if you press the middle button to pause the existing album and press again to play the album on the page.

Other -----------------
- Programming Windows Phone 7 : Pivot and Panorama - Compare and Contrast
- Programming Windows Phone 7 : Elements and Properties - Modes of Opacity
- Programming Windows Phone 7 : Elements and Properties - Non-Tiled Tile Brushes & Playing Movies
- Programming Windows Phone 7 : Items Controls - A Card File Metaphor
- Programming Windows Phone 7 : Items Controls - The DataTemplate Bar Chart
- Programming Windows Phone 7 : Items Controls - Changing the Panel
- Programming Windows Phone 7 : Items Controls - Sorting
- Items Controls : Fun with DataTemplates
- Items Controls : Databases and Business Objects
- Items Controls : Binding to ItemsSource
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server