consolidate all repos to one for archive
17
semester_3/uporabniski_vmesniki/MyApp/App.xaml
Normal file
@@ -0,0 +1,17 @@
|
||||
<Application x:Class="MyApp.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:MyApp"
|
||||
StartupUri="MainWindow.xaml">
|
||||
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Resorce/ButtonDictionary.xaml"/>
|
||||
<ResourceDictionary Source="Resorce/ImageDictionary.xaml"/>
|
||||
<ResourceDictionary Source="Resorce/ListDictionary.xaml"/>
|
||||
<ResourceDictionary Source="Resorce/WindowDictionary.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
17
semester_3/uporabniski_vmesniki/MyApp/App.xaml.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace MyApp
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
||||
}
|
10
semester_3/uporabniski_vmesniki/MyApp/AssemblyInfo.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System.Windows;
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
36
semester_3/uporabniski_vmesniki/MyApp/EditWindow.xaml
Normal file
@@ -0,0 +1,36 @@
|
||||
<Window x:Class="MyApp.EditWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:MyApp"
|
||||
mc:Ignorable="d"
|
||||
Title="EditWindow" Height="450" Width="400">
|
||||
<Grid Margin="10">
|
||||
<StackPanel>
|
||||
<Label Content="Ime datoteke:"/>
|
||||
<TextBox Text="{Binding Path=Name, Mode=TwoWay}"/>
|
||||
|
||||
<Label Content="Zvrsti:"/>
|
||||
<ComboBox
|
||||
Name="comboBox"
|
||||
SelectionChanged="comboBox_SelectionChanged"
|
||||
Text="Haha"
|
||||
SelectedValue="{Binding Path=Genra}">
|
||||
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<Image Name="MovieIcon" Source="{Binding Path=IconSource}" Style="{StaticResource BigImage}"/>
|
||||
|
||||
<Button Click="Image_Button_Click" Content="Change Imgae"/>
|
||||
<Label Content="Pot datoteke:"/>
|
||||
<TextBlock TextWrapping="Wrap" Text="{Binding Path=FilePath}"/>
|
||||
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
47
semester_3/uporabniski_vmesniki/MyApp/EditWindow.xaml.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
|
||||
namespace MyApp
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for EditWindow.xaml
|
||||
/// </summary>
|
||||
public partial class EditWindow : Window
|
||||
{
|
||||
ProgramData data;
|
||||
|
||||
internal EditWindow(ProgramData data)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.data = data;
|
||||
this.DataContext = data.SelectedItem;
|
||||
comboBox.ItemsSource = data.GenreList;
|
||||
}
|
||||
|
||||
private void Image_Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dialog = new Microsoft.Win32.OpenFileDialog();
|
||||
//dialog.FileName = "Document"; // Default file name
|
||||
dialog.DefaultExt = "*.*"; // Default file extension
|
||||
dialog.Filter = "Image Files|*.BMP;*.DIB;*.RLE;*.JPG;*.JPEG;*.JPE;*.JFIF;*.GIF;*.TIF;*.TIFF;*.PNG;";
|
||||
|
||||
bool? result = dialog.ShowDialog();
|
||||
if (result == true)
|
||||
{
|
||||
data.SelectedItem.IconSource = dialog.FileName;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if(comboBox.SelectedItem is string s)
|
||||
{
|
||||
data.SelectedItem.Genra = s;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
146
semester_3/uporabniski_vmesniki/MyApp/MainWindow.xaml
Normal file
@@ -0,0 +1,146 @@
|
||||
<Window x:Class="MyApp.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:MyApp"
|
||||
mc:Ignorable="d"
|
||||
Closing="Window_Closing"
|
||||
Style="{StaticResource MainWindow}">
|
||||
|
||||
<Grid Background="Transparent">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="20"/>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="70"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<DockPanel Grid.Row="0">
|
||||
<Menu>
|
||||
<MenuItem Header="Datoteka">
|
||||
<MenuItem Header="Izhod" Click="MenuItem_Exit_Click"/>
|
||||
<MenuItem Header="Shrani" Click="MenuItem_Save_Click"/>
|
||||
<MenuItem Header="Uvozi" Click="MenuItem_Load_Click"/>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Seznam">
|
||||
<MenuItem Header="Dodaj" Click="MenuItem_Add_Click"/>
|
||||
<MenuItem Header="Odstrani" Click="MenuItem_Remove_Click" IsEnabled="{Binding SelectedItems.Count, ElementName=PlayListView}"/>
|
||||
<MenuItem Header="Uredi" Click="MenuItem_Edit_Click" IsEnabled="{Binding SelectedItems.Count, ElementName=PlayListView}"/>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Orodje">
|
||||
<MenuItem Header="Nastavitve" Click="MenuItem_Settings_Click"/>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</DockPanel>
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="150"/>
|
||||
<ColumnDefinition Width="2"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<ListView Style="{StaticResource Playlist}" Name="PlayListView" SelectionChanged="PlayListView_SelectionChanged" MouseDoubleClick="PlayListView_MouseDoubleClick">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<Label Name="Naslov" Content="{Binding Path=Name}"/>
|
||||
<Image Source="{Binding Path=IconSource}" Style="{StaticResource SmallImage}"/>
|
||||
</StackPanel>
|
||||
|
||||
<DataTemplate.Triggers>
|
||||
<DataTrigger Binding="{Binding Path=IsPlaying }" Value="True">
|
||||
<Setter TargetName="Naslov" Property="Foreground" Value="Green"/>
|
||||
</DataTrigger>
|
||||
</DataTemplate.Triggers>
|
||||
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
|
||||
<ListView.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="Dodaj" Click="MenuItem_Add_Click" />
|
||||
<MenuItem Header="Odstrani" Click="MenuItem_Remove_Click" />
|
||||
<MenuItem Header="Uredi" Click="MenuItem_Edit_Click"/>
|
||||
</ContextMenu>
|
||||
</ListView.ContextMenu>
|
||||
|
||||
</ListView>
|
||||
|
||||
<GridSplitter Grid.Column="1" Width="2" HorizontalAlignment="Stretch"/>
|
||||
|
||||
<local:MediaController x:Name="MediaPlayer"
|
||||
Grid.Column="2"
|
||||
OnTimeChage="MediaPlayer_OnTimeChage"
|
||||
OnMediaLoad="MediaPlayer_OnMediaLoad"/>
|
||||
|
||||
|
||||
<Canvas HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2">
|
||||
<Ellipse Width="10" Height="10" Fill="Black" >
|
||||
<Ellipse.Triggers>
|
||||
<EventTrigger RoutedEvent="Ellipse.Loaded">
|
||||
<BeginStoryboard>
|
||||
<Storyboard RepeatBehavior="Forever" Duration="0:0:1">
|
||||
<DoubleAnimationUsingPath Source="X" Storyboard.TargetProperty="(Canvas.Left)"
|
||||
PathGeometry="{StaticResource Krozenje}" />
|
||||
<DoubleAnimationUsingPath Source="Y" Storyboard.TargetProperty="(Canvas.Top)"
|
||||
PathGeometry="{StaticResource Krozenje}" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</EventTrigger>
|
||||
</Ellipse.Triggers>
|
||||
</Ellipse>
|
||||
</Canvas>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
<Border Grid.Row="2" BorderBrush="Black" BorderThickness="2">
|
||||
<Grid >
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30"/>
|
||||
<RowDefinition Height="40"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<DockPanel Grid.Row="0">
|
||||
<Label Name="CurrentTime" Content="00:00:00"/>
|
||||
<Label Content="/"/>
|
||||
<Label Name="TotalTime" Content="00:00:00"/>
|
||||
|
||||
<Slider Name="ProgresBar"
|
||||
Thumb.DragCompleted="ProgresBar_DragCompleted"
|
||||
Thumb.DragStarted="ProgresBar_DragStarted"
|
||||
Margin="5"/>
|
||||
|
||||
</DockPanel>
|
||||
|
||||
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<Button Click="PlayButton_Click" Style="{StaticResource ControllButton}">
|
||||
<Image Name="PlayPouseImg" Source="pack://application:,,,/assets/play_icon.png"/>
|
||||
</Button>
|
||||
<Button Style="{StaticResource ControllButton}" Click="Rewind_Click">
|
||||
<Image Source="pack://application:,,,/assets/next_icon.png" RenderTransformOrigin="0.5,0.5">
|
||||
<Image.RenderTransform>
|
||||
<ScaleTransform ScaleX="-1"/>
|
||||
</Image.RenderTransform>
|
||||
</Image>
|
||||
</Button>
|
||||
<Button Style="{StaticResource ControllButton}" Click="Stop_Click">
|
||||
<Image Source="pack://application:,,,/assets/stop_icon.png" Margin="3"/>
|
||||
</Button>
|
||||
<Button Style="{StaticResource ControllButton}" Click="Forward_Click">
|
||||
<Image Source="pack://application:,,,/assets/next_icon.png" />
|
||||
</Button>
|
||||
<Button Style="{StaticResource ControllButton}">
|
||||
<Image Source="pack://application:,,,/assets/shuffle_icon.png"/>
|
||||
</Button>
|
||||
<Button Style="{StaticResource ControllButton}">
|
||||
<Image Source="pack://application:,,,/assets/repeat_icon.png"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Window>
|
277
semester_3/uporabniski_vmesniki/MyApp/MainWindow.xaml.cs
Normal file
@@ -0,0 +1,277 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Threading;
|
||||
using System.Xml.Serialization;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace MyApp
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
ProgramData data = new ProgramData();
|
||||
string fileName = "";
|
||||
int currentlyPlaying = 0;
|
||||
bool progresBarDragging = false;
|
||||
EditWindow? editWindow = null;
|
||||
public DispatcherTimer timer = new DispatcherTimer();
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = this;
|
||||
PlayListView.ItemsSource = data.PlayList;
|
||||
|
||||
timer.Interval = TimeSpan.FromMinutes(1);
|
||||
timer.Tick += AutoUpdate;
|
||||
}
|
||||
|
||||
private void AutoUpdate(object? sender, EventArgs e)
|
||||
{
|
||||
Save();
|
||||
}
|
||||
void Save()
|
||||
{
|
||||
if (fileName == "")
|
||||
{
|
||||
SaveFileDialog dialog = new SaveFileDialog();
|
||||
dialog.FileName = "Save";
|
||||
dialog.DefaultExt = "*.xml";
|
||||
dialog.Filter = "Data|*.xml";
|
||||
dialog.RestoreDirectory = true;
|
||||
|
||||
if (dialog.ShowDialog() == true)
|
||||
{
|
||||
fileName = dialog.FileName;
|
||||
}
|
||||
}
|
||||
|
||||
if (fileName != "")
|
||||
{
|
||||
using (StreamWriter sw = new StreamWriter(fileName))
|
||||
{
|
||||
XmlSerializer xml = new XmlSerializer(typeof(ProgramData));
|
||||
xml.Serialize(sw, data);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
void Load()
|
||||
{
|
||||
if (fileName == "") return;
|
||||
using (StreamReader sr = new StreamReader(fileName))
|
||||
{
|
||||
XmlSerializer xml = new XmlSerializer(typeof(ProgramData));
|
||||
|
||||
if (xml.Deserialize(sr) is ProgramData m)
|
||||
{
|
||||
data = m;
|
||||
PlayListView.ItemsSource = data.PlayList;
|
||||
|
||||
if(data.AutoSave) timer.Start();
|
||||
else timer.Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
void Window_Closing(object sender, CancelEventArgs e)
|
||||
{
|
||||
if(fileName == "")
|
||||
{
|
||||
MessageBoxResult result = MessageBox.Show("Data was not saved.\n Do you want to save it?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning);
|
||||
if (result == MessageBoxResult.Yes)
|
||||
{
|
||||
//e.Cancel = true;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Save();
|
||||
}
|
||||
}
|
||||
private void PlayButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!MediaPlayer.IsPlaying())
|
||||
{
|
||||
PlayPouseImg.Source = new BitmapImage(new Uri("pack://application:,,,/assets/pause_icon.png"));
|
||||
MediaPlayer.Play();
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayPouseImg.Source = new BitmapImage(new Uri("pack://application:,,,/assets/play_icon.png"));
|
||||
MediaPlayer.Pause();
|
||||
}
|
||||
}
|
||||
private void Stop_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MediaPlayer.Stop();
|
||||
ProgresBar.Value = 0;
|
||||
CurrentTime.Content = TimeSpan.FromSeconds(0).ToString(@"hh\:mm\:ss");
|
||||
PlayPouseImg.Source = new BitmapImage(new Uri("pack://application:,,,/assets/play_icon.png"));
|
||||
|
||||
}
|
||||
private void Rewind_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
data.PlayList[currentlyPlaying].IsPlaying = false;
|
||||
currentlyPlaying--;
|
||||
if (currentlyPlaying < 0)
|
||||
{
|
||||
currentlyPlaying = 0;
|
||||
}
|
||||
MediaPlayer.ChangeContent(data.PlayList[currentlyPlaying].FilePath);
|
||||
data.PlayList[currentlyPlaying].IsPlaying = true;
|
||||
}
|
||||
private void Forward_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
data.PlayList[currentlyPlaying].IsPlaying = false;
|
||||
currentlyPlaying++;
|
||||
if (currentlyPlaying >= data.PlayList.Count)
|
||||
{
|
||||
currentlyPlaying = data.PlayList.Count - 1;
|
||||
}
|
||||
MediaPlayer.ChangeContent(data.PlayList[currentlyPlaying].FilePath);
|
||||
data.PlayList[currentlyPlaying].IsPlaying = true;
|
||||
}
|
||||
private void ProgresBar_DragCompleted(object sender, System.Windows.Controls.Primitives.DragCompletedEventArgs e)
|
||||
{
|
||||
progresBarDragging = false;
|
||||
MediaPlayer.ChangeTime(ProgresBar.Value);
|
||||
}
|
||||
private void ProgresBar_DragStarted(object sender, System.Windows.Controls.Primitives.DragStartedEventArgs e)
|
||||
{
|
||||
progresBarDragging = true;
|
||||
}
|
||||
private void PlayListView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (PlayListView.SelectedItem is Media m)
|
||||
{
|
||||
data.PlayList[currentlyPlaying].IsPlaying = false;
|
||||
m.IsPlaying = true;
|
||||
MediaPlayer.ChangeContent(m.FilePath);
|
||||
MediaPlayer.Play();
|
||||
PlayPouseImg.Source = new BitmapImage(new Uri("pack://application:,,,/assets/pause_icon.png"));
|
||||
currentlyPlaying = PlayListView.SelectedIndex;
|
||||
}
|
||||
}
|
||||
private void PlayListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (PlayListView.SelectedItem is Media m)
|
||||
{
|
||||
data.SelectedItem = m;
|
||||
if (editWindow != null)
|
||||
{
|
||||
if (data.SelectedItem == null) { editWindow.Close(); }
|
||||
else { editWindow.DataContext = data.SelectedItem; }
|
||||
}
|
||||
}
|
||||
}
|
||||
private void MenuItem_Exit_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Application.Current.Shutdown();
|
||||
}
|
||||
private void MenuItem_Add_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dialog = new OpenFileDialog();
|
||||
//dialog.FileName = "Document"; // Default file name
|
||||
dialog.DefaultExt = "*.*"; // Default file extension
|
||||
dialog.Filter = "All files|*.*|Video media|*.mkv;*.wmv;*.mp4"; // Filter files by extension
|
||||
dialog.Multiselect = true;
|
||||
|
||||
bool? result = dialog.ShowDialog();
|
||||
if (result == true)
|
||||
{
|
||||
|
||||
string[] files = dialog.FileNames;
|
||||
foreach(string file in files)
|
||||
{
|
||||
string filename = file.Split("\\").Last();
|
||||
data.PlayList.Add(new Media(filename, file));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
private void MenuItem_Remove_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if(PlayListView.SelectedItem is Media m)
|
||||
{
|
||||
if(editWindow != null) { editWindow.Close(); }
|
||||
data.PlayList.Remove(m);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Nothing was selected");
|
||||
}
|
||||
|
||||
}
|
||||
private void MenuItem_Settings_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SettingsWindow? settingsWindow = new SettingsWindow(data);
|
||||
settingsWindow.Owner = this;
|
||||
settingsWindow.ShowDialog();
|
||||
|
||||
}
|
||||
private void MenuItem_Save_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Save();
|
||||
}
|
||||
private void MenuItem_Edit_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if(!(PlayListView.SelectedItem is Media)) return;
|
||||
if(editWindow == null)
|
||||
{
|
||||
editWindow = new EditWindow(data);
|
||||
editWindow.Owner = this;
|
||||
editWindow.Show();
|
||||
}
|
||||
if (!editWindow.IsLoaded)
|
||||
{
|
||||
editWindow = new EditWindow(data);
|
||||
editWindow.Owner = this;
|
||||
editWindow.Show();
|
||||
}
|
||||
}
|
||||
private void MenuItem_Load_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
OpenFileDialog dialog = new OpenFileDialog();
|
||||
dialog.FileName = "Save"; // Default file name
|
||||
dialog.DefaultExt = "*.xml"; // Default file extension
|
||||
dialog.Filter = "Data|*.xml"; // Filter files by extension
|
||||
|
||||
bool? result = dialog.ShowDialog();
|
||||
if (result == true)
|
||||
{
|
||||
fileName = dialog.FileName;
|
||||
Load();
|
||||
}
|
||||
}
|
||||
private void MediaPlayer_OnTimeChage(object sender, double time)
|
||||
{
|
||||
if (!progresBarDragging)
|
||||
{
|
||||
ProgresBar.Value = time;
|
||||
CurrentTime.Content = TimeSpan.FromSeconds(time).ToString(@"hh\:mm\:ss");
|
||||
}
|
||||
}
|
||||
private void MediaPlayer_OnMediaLoad(object sender, bool loded, double totalTimeInMilS)
|
||||
{
|
||||
if (loded)
|
||||
{
|
||||
ProgresBar.Minimum = 0;
|
||||
ProgresBar.Maximum = totalTimeInMilS;
|
||||
TotalTime.Content = TimeSpan.FromSeconds(totalTimeInMilS).ToString(@"hh\:mm\:ss");
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayPouseImg.Source = new BitmapImage(new Uri("pack://application:,,,/assets/play_icon.png"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
79
semester_3/uporabniski_vmesniki/MyApp/Media.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace MyApp
|
||||
{
|
||||
public class Media : INotifyPropertyChanged
|
||||
{
|
||||
public string Name
|
||||
{
|
||||
get { return name; }
|
||||
set
|
||||
{
|
||||
name = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
string name = "";
|
||||
|
||||
public string IconSource
|
||||
{
|
||||
get { return iconSource; }
|
||||
set
|
||||
{
|
||||
iconSource = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
string iconSource = "";
|
||||
|
||||
public string FilePath
|
||||
{
|
||||
get { return filePath; }
|
||||
set
|
||||
{
|
||||
filePath = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
string filePath = "";
|
||||
|
||||
[XmlIgnore]
|
||||
public bool IsPlaying
|
||||
{
|
||||
get { return isPlaying; }
|
||||
set
|
||||
{
|
||||
isPlaying = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
bool isPlaying = false;
|
||||
|
||||
public string Genra
|
||||
{
|
||||
get { return genra; }
|
||||
set
|
||||
{
|
||||
genra = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
string genra = "";
|
||||
|
||||
public Media(string name, string filePath)
|
||||
{
|
||||
this.name = name;
|
||||
this.filePath = filePath;
|
||||
iconSource = "pack://application:,,,/assets/video_icon.png";
|
||||
}
|
||||
public Media() { }
|
||||
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
protected void OnPropertyChanged([CallerMemberName] string? name = null)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
|
||||
}
|
||||
}
|
||||
}
|
17
semester_3/uporabniski_vmesniki/MyApp/MediaController.xaml
Normal file
@@ -0,0 +1,17 @@
|
||||
<UserControl x:Class="MyApp.MediaController"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:MyApp"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<MediaElement
|
||||
Name="MediaPlayer"
|
||||
LoadedBehavior="Manual"
|
||||
MediaOpened="MediaPlayer_MediaOpened"
|
||||
MediaEnded="MediaPlayer_MediaEnded"
|
||||
UnloadedBehavior="Stop"/>
|
||||
</Grid>
|
||||
</UserControl>
|
@@ -0,0 +1,89 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace MyApp
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MediaController.xaml
|
||||
/// </summary>
|
||||
public partial class MediaController : UserControl
|
||||
{
|
||||
|
||||
DispatcherTimer timer;
|
||||
bool isPlaying = false;
|
||||
|
||||
public MediaController()
|
||||
{
|
||||
InitializeComponent();
|
||||
timer = new DispatcherTimer();
|
||||
timer.Interval = TimeSpan.FromSeconds(1);
|
||||
timer.Tick += Timer_Tick;
|
||||
}
|
||||
|
||||
public delegate void TimeChange(object sender, double time);
|
||||
public event TimeChange? OnTimeChage;
|
||||
|
||||
public delegate void MediaLoded(object sender, bool loded, double totalTimeInMilS);
|
||||
public event MediaLoded? OnMediaLoad;
|
||||
|
||||
private void Timer_Tick(object? sender, EventArgs e)
|
||||
{
|
||||
OnTimeChage?.Invoke(this, MediaPlayer.Position.TotalSeconds);
|
||||
}
|
||||
|
||||
public bool IsPlaying()
|
||||
{
|
||||
return isPlaying;
|
||||
}
|
||||
|
||||
public void Play()
|
||||
{
|
||||
timer.Start();
|
||||
MediaPlayer.Play();
|
||||
isPlaying = true;
|
||||
}
|
||||
public void Stop()
|
||||
{
|
||||
timer.Stop();
|
||||
MediaPlayer.Stop();
|
||||
isPlaying = false;
|
||||
OnMediaLoad?.Invoke(this, false, 0);
|
||||
}
|
||||
public void Pause()
|
||||
{
|
||||
timer.Stop();
|
||||
MediaPlayer.Pause();
|
||||
isPlaying = false;
|
||||
}
|
||||
|
||||
public void ChangeTime(double time)
|
||||
{
|
||||
MediaPlayer.Position = TimeSpan.FromSeconds(time);
|
||||
}
|
||||
|
||||
public void ChangeContent(string contentAdress)
|
||||
{
|
||||
|
||||
MediaPlayer.Stop();
|
||||
timer.Stop();
|
||||
isPlaying = false;
|
||||
MediaPlayer.Source = new Uri(contentAdress);
|
||||
OnMediaLoad?.Invoke(this, false, 0);
|
||||
}
|
||||
|
||||
private void MediaPlayer_MediaOpened(object sender, RoutedEventArgs e)
|
||||
{
|
||||
OnMediaLoad?.Invoke(this, true, MediaPlayer.NaturalDuration.TimeSpan.TotalSeconds);
|
||||
}
|
||||
|
||||
private void MediaPlayer_MediaEnded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
timer?.Stop();
|
||||
MediaPlayer.Stop();
|
||||
isPlaying = false;
|
||||
OnMediaLoad?.Invoke(this, false, 0);
|
||||
}
|
||||
}
|
||||
}
|
66
semester_3/uporabniski_vmesniki/MyApp/MyApp.csproj
Normal file
@@ -0,0 +1,66 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWPF>true</UseWPF>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="assets\film-icon.png" />
|
||||
<None Remove="assets\next_icon.png" />
|
||||
<None Remove="assets\pause_icon.png" />
|
||||
<None Remove="assets\play_icon.png" />
|
||||
<None Remove="assets\repeat_icon.png" />
|
||||
<None Remove="assets\rewind_icon.png" />
|
||||
<None Remove="assets\shuffle_icon.png" />
|
||||
<None Remove="assets\stop_icon.png" />
|
||||
<None Remove="assets\video_icon.png" />
|
||||
<None Remove="play_icon.png" />
|
||||
<None Remove="repeat_icon.png" />
|
||||
<None Remove="rewind_icon.png" />
|
||||
<None Remove="shuffle_icon.png" />
|
||||
<None Remove="stop_icon.png" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<COMReference Include="{d37e2a3e-8545-3a39-9f4f-31827c9124ab}">
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
<VersionMinor>4</VersionMinor>
|
||||
<VersionMajor>2</VersionMajor>
|
||||
<Guid>d37e2a3e-8545-3a39-9f4f-31827c9124ab</Guid>
|
||||
</COMReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Resource Include="assets\film-icon.png" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Resource Include="assets\next_icon.png" />
|
||||
<Resource Include="assets\pause_icon.png" />
|
||||
<Resource Include="assets\play_icon.png" />
|
||||
<Resource Include="assets\repeat_icon.png" />
|
||||
<Resource Include="assets\rewind_icon.png" />
|
||||
<Resource Include="assets\shuffle_icon.png" />
|
||||
<Resource Include="assets\stop_icon.png" />
|
||||
<Resource Include="assets\video_icon.png" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Resources.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
31
semester_3/uporabniski_vmesniki/MyApp/ProgramData.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace MyApp
|
||||
{
|
||||
public class ProgramData
|
||||
{
|
||||
ObservableCollection<Media> playList = new ObservableCollection<Media>();
|
||||
ObservableCollection<string> genreList = new ObservableCollection<string>();
|
||||
Media selectedItem = new Media("Ha", "ha");
|
||||
bool autoSave = false;
|
||||
|
||||
public bool AutoSave { get; set; }
|
||||
|
||||
public ObservableCollection<Media> PlayList
|
||||
{
|
||||
get { return playList; }
|
||||
set { playList = value; }
|
||||
}
|
||||
public ObservableCollection<string> GenreList
|
||||
{
|
||||
get { return genreList; }
|
||||
set { genreList = value; }
|
||||
}
|
||||
public Media SelectedItem
|
||||
{
|
||||
get { return selectedItem; }
|
||||
set { selectedItem = value; }
|
||||
}
|
||||
}
|
||||
}
|
123
semester_3/uporabniski_vmesniki/MyApp/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,123 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace MyApp.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MyApp.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] pause_icon {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("pause_icon", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] play_icon {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("play_icon", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] repeat_icon {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("repeat_icon", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] rewind_icon {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("rewind_icon", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] shuffle_icon {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("shuffle_icon", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] stop_icon {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("stop_icon", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
139
semester_3/uporabniski_vmesniki/MyApp/Properties/Resources.resx
Normal file
@@ -0,0 +1,139 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="pause_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\assets\pause_icon.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="play_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\assets\play_icon.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="repeat_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\assets\repeat_icon.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="rewind_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\assets\rewind_icon.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="shuffle_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\assets\shuffle_icon.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="stop_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\assets\stop_icon.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
</root>
|
@@ -0,0 +1,29 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<Style TargetType="Button" x:Key="ControllButton">
|
||||
<Setter Property="Background" Value="Aquamarine"/>
|
||||
<Setter Property="Margin" Value="5,5,5,5"/>
|
||||
<Setter Property="Padding" Value="2"/>
|
||||
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Trigger.EnterActions>
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" BeginTime="00:00:00">
|
||||
<SplineThicknessKeyFrame KeyTime="00:00:00" Value="10,5,10,5"/>
|
||||
<SplineThicknessKeyFrame KeyTime="00:00:01" Value="5,5,5,5"/>
|
||||
</ThicknessAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</Trigger.EnterActions>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ResourceDictionary>
|
@@ -0,0 +1,15 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<Style TargetType="Image" x:Key="SmallImage">
|
||||
<Setter Property="Width" Value="32"/>
|
||||
<Setter Property="Height" Value="32"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Left"/>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Image" x:Key="BigImage">
|
||||
<Setter Property="Width" Value="100"/>
|
||||
<Setter Property="Height" Value="100"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
@@ -0,0 +1,7 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Style TargetType="ListView" x:Key="Playlist">
|
||||
<Setter Property="Grid.Column" Value="0"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
@@ -0,0 +1,19 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Style TargetType="Window" x:Key="MainWindow">
|
||||
<Setter Property="Title" Value="VideoPlayer I don't know?"/>
|
||||
<Setter Property="Height" Value="450"/>
|
||||
<Setter Property="Width" Value="800"/>
|
||||
<Setter Property="MinHeight" Value="450"/>
|
||||
<Setter Property="MinWidth" Value="800"/>
|
||||
<Setter Property="Icon" Value="pack://application:,,,/assets/film-icon.png"/>
|
||||
<Setter Property="Background" Value="LightGoldenrodYellow"/>
|
||||
</Style>
|
||||
|
||||
<PathGeometry x:Key="Krozenje">
|
||||
<PathFigure StartPoint="0,0">
|
||||
<ArcSegment IsLargeArc="True" Size="10,10" Point="1,0" SweepDirection="Clockwise" />
|
||||
</PathFigure>
|
||||
</PathGeometry>
|
||||
|
||||
</ResourceDictionary>
|
39
semester_3/uporabniski_vmesniki/MyApp/SettingsWindow.xaml
Normal file
@@ -0,0 +1,39 @@
|
||||
<Window x:Class="MyApp.SettingsWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:MyApp"
|
||||
mc:Ignorable="d"
|
||||
Title="Settings" Height="450" Width="800" ResizeMode="NoResize">
|
||||
<Grid Margin="5">
|
||||
<TabControl>
|
||||
<TabItem Header="Something">
|
||||
<Grid Background="#FFE5E5E5">
|
||||
<StackPanel>
|
||||
<CheckBox Name="CheckAutoSave" Content="AutoSave" Click="CheckBox_Click"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="Zvrst">
|
||||
<Grid Background="#FFE5E5E5">
|
||||
<StackPanel>
|
||||
<TextBox Name="InputTextBox" Height="30"/>
|
||||
<Button Content="Add" Click="Add_Click" Height="25"/>
|
||||
<Button Content="Remove" Click="Remove_Click" Height="25"/>
|
||||
<ListView Name="GenreListView">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<Label Content="{Binding}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
53
semester_3/uporabniski_vmesniki/MyApp/SettingsWindow.xaml.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
|
||||
namespace MyApp
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for Settings.xaml
|
||||
/// </summary>
|
||||
public partial class SettingsWindow : Window
|
||||
{
|
||||
ProgramData data;
|
||||
internal SettingsWindow(ProgramData pD)
|
||||
{
|
||||
InitializeComponent();
|
||||
data = pD;
|
||||
GenreListView.ItemsSource = data.GenreList;
|
||||
}
|
||||
|
||||
private void Add_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (InputTextBox.Text != "")
|
||||
data.GenreList.Add(InputTextBox.Text);
|
||||
}
|
||||
|
||||
private void Remove_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (GenreListView.SelectedItem is String s)
|
||||
{
|
||||
data.GenreList.Remove(s);
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckBox_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (CheckAutoSave.IsChecked is bool check)
|
||||
{
|
||||
if (Owner is MainWindow my)
|
||||
{
|
||||
if (check)
|
||||
{
|
||||
my.timer.Start();
|
||||
data.AutoSave = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
my.timer.Stop();
|
||||
data.AutoSave = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
BIN
semester_3/uporabniski_vmesniki/MyApp/assets/film-icon.png
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
semester_3/uporabniski_vmesniki/MyApp/assets/next_icon.png
Normal file
After Width: | Height: | Size: 458 B |
BIN
semester_3/uporabniski_vmesniki/MyApp/assets/pause_icon.png
Normal file
After Width: | Height: | Size: 156 B |
BIN
semester_3/uporabniski_vmesniki/MyApp/assets/play_icon.png
Normal file
After Width: | Height: | Size: 361 B |
BIN
semester_3/uporabniski_vmesniki/MyApp/assets/repeat_icon.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
semester_3/uporabniski_vmesniki/MyApp/assets/rewind_icon.png
Normal file
After Width: | Height: | Size: 501 B |
BIN
semester_3/uporabniski_vmesniki/MyApp/assets/shuffle_icon.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
semester_3/uporabniski_vmesniki/MyApp/assets/stop_icon.png
Normal file
After Width: | Height: | Size: 246 B |
BIN
semester_3/uporabniski_vmesniki/MyApp/assets/video_icon.png
Normal file
After Width: | Height: | Size: 1.3 KiB |