Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion MediaPlayerWindow/MediaPlayerModels/PlayListClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;

namespace MediaPlayerModels
{
{
[DataContract]
public class PlayListClass
{
[DataMember]
public string FileName { get; set; }

[DataMember]
public string Filepath { get; set; }
}
Expand Down
6 changes: 3 additions & 3 deletions MediaPlayerWindow/MediaPlayerModels/PlayListDirectory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
namespace MediaPlayerModels
{
[DataContract]
public class PlayListDirectory
public class PlayListDirectory
{

private List<PlayListClass> playListCollection=new List<PlayListClass>();
private List<PlayListClass> playListCollection = new List<PlayListClass>();

[DataMember]
public List<PlayListClass> PlayListCollection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using System.Windows.Input;
using Button = System.Windows.Controls.Button;
using System.Runtime.Serialization;

namespace MediaPlayerViewModel
{
public class MediaPlayerMainWindowViewModel:INotifyPropertyChanged
Expand Down Expand Up @@ -74,10 +75,11 @@ public ObservableCollection<ObservableCollection<Uri>> AlbumsViewCollection
public bool PlayRequested
{
get { return _playRequested; }
set { _playRequested = value; OnPropertyChanged("PlayRequested");

set
{
_playRequested = value;
OnPropertyChanged("PlayRequested");
}

}

public bool MediaOpened
Expand All @@ -93,17 +95,13 @@ public Uri MediaSource
set
{
_mediaSource = value;

OnPropertyChanged("MediaSource");

}
}


public ICommand OpenFileCommand
{
get { return new DelegateCommand(OpenFileMethod, IsValid); }

}

public ICommand ShowHidePlayListCommand
Expand Down Expand Up @@ -288,7 +286,6 @@ protected virtual void OnMoveBackwardRequested()
#region Methods
private void OpenFileMethod(object obj)
{

System.Windows.Forms.OpenFileDialog dialog = new System.Windows.Forms.OpenFileDialog();
dialog.Filter =
"Audio Files (*.mp3,*.m4a,*.wav,*.aac)|*.mp3|Video Files(*.mp4,*.wmv,*.3gp,*.mkv)|*.mp4|All Files(*.*)|*.*";
Expand All @@ -308,10 +305,7 @@ private void OpenFileMethod(object obj)
{

}


}

}

private void VolumeUpMethod(object o)
Expand All @@ -323,6 +317,7 @@ private void FullScreenMethod(object o)
{
OnFullScreeEvent();
}

private void VolumeDownMethod(Object o)
{
OnVolumeDownEvent();
Expand All @@ -332,14 +327,17 @@ private void SpeedRatioUpMethod(object o)
{
OnSpeedRatioUpEvent();
}

private void SpeedRatioDownMethod(object o)
{
OnSpeedRatioDownEvent();
}

private void MediaOpenedMethod(Object obj)
{
MediaOpened = true;
}

private void SavePlaylist(Object obj)
{

Expand All @@ -354,16 +352,15 @@ private void SavePlaylist(Object obj)
{
PlayListDirectory playListDirectory=new PlayListDirectory();


List<PlayListClass> _mediaList = new List<PlayListClass>();
foreach (Uri file in PlayListViewCollection )
{
PlayListClass temp = new PlayListClass();
temp.FileName = file.ToString();
temp.Filepath = playlistLookupDictionary[file.ToString()].ToString();
_mediaList.Add(temp);

}

playListDirectory.PlayListCollection = _mediaList;
_xmlSerializer.Serialize(_textWriter, playListDirectory);
}
Expand Down Expand Up @@ -399,14 +396,7 @@ private void OpenPlayList(Object obj)

}
}






}

}

private void ChangeBackground(Object obj)
Expand Down Expand Up @@ -446,14 +436,12 @@ private void ShowHidePlayListMethod(Object obj)
}
}


private void StopMediaFileMethod(Object Obj)
{
OnStopRequested();
playValue = !playValue;
}


private void MoveForwardMediaFileMethod(Object Obj)
{
OnMoveForwardRequested();
Expand Down Expand Up @@ -490,14 +478,12 @@ private void PlayListMethod(Object obj)
{

}

}
}
}

private void PlayMediaFileMethod(Object obj)
{

ToggleButton PlayFileButtonObj = obj as ToggleButton;
if (obj == null)
{
Expand All @@ -511,8 +497,6 @@ private void PlayMediaFileMethod(Object obj)
OnPauseRequested();
playValue = true;
}


}
else
{
Expand All @@ -521,13 +505,10 @@ private void PlayMediaFileMethod(Object obj)
if (PlayFileButtonObj.IsChecked.Value)
{
OnPlayValueRequested();


}
else
{
OnPauseRequested();

}
}
}
Expand All @@ -554,17 +535,12 @@ private void AlbumsCreateMethod()
}
}


private bool IsValid()
{
// if (obj == null) throw new ArgumentNullException("obj");
return true;
}

#endregion




}
}