2011-01-03, 12:28
Can I make a suggestion?
How about making every object that can be added to a playlist (i.e. Song, Movie, MusicVideo etc.) inherit a common interface/implement a common abstract class? I think at the least that Label is a common field among them all (maybe even a common ID field). That would allow you to do the following :
Also... How about adding property changed notifiers? Then your library can also be used in MVVM Silverlight or WPF applications.
PM me so I can contribute.
EDIT: Don't think Mono supports INotifyPropertyChanged, so if you're aim is compatibility, ignore.
How about making every object that can be added to a playlist (i.e. Song, Movie, MusicVideo etc.) inherit a common interface/implement a common abstract class? I think at the least that Label is a common field among them all (maybe even a common ID field). That would allow you to do the following :
Code:
CommonPlayListItem pi;
switch (currentDisplayMode)
{
case DisplayMode.AudioPlaying:
pi = mainConn.AudioPlaylist.GetCurrentItem();
break;
case DisplayMode.PicturesPlaying:
pi = mainConn.PicturePlayer.GetCurrentItem();
break;
case DisplayMode.VideoPlaying:
pi = mainConn.VideoPlaylist.GetCurrentItem();
break;
}
WriteToLCD(pi.Label);
Also... How about adding property changed notifiers? Then your library can also be used in MVVM Silverlight or WPF applications.
PM me so I can contribute.
EDIT: Don't think Mono supports INotifyPropertyChanged, so if you're aim is compatibility, ignore.