Commit 89ae75b0 authored by Holger's avatar Holger
Browse files

SoundPlayer durch WMPLib.WindowsMediaPlayer ersetzt. Wave-Dateien durch MP3-Dateien ersetzt.

parent 3c133925
Pipeline #842 failed with stages
in 28 seconds
...@@ -143,16 +143,23 @@ ...@@ -143,16 +143,23 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource> </Resource>
<Resource Include="Kategroievorschlaege.txt" /> <Resource Include="Kategroievorschlaege.txt" />
<Content Include="Media\Jeopardy_Theme_light.m4a"> </ItemGroup>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <ItemGroup>
</Content> <COMReference Include="WMPLib">
<Content Include="Media\Jeopardy_Theme_light.wav"> <Guid>{6BF52A50-394A-11D3-B153-00C04F79FAA6}</Guid>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <VersionMajor>1</VersionMajor>
</Content> <VersionMinor>0</VersionMinor>
<Content Include="Media\Jeopardy_Theme_retro.m4a"> <Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>
<ItemGroup>
<Content Include="Media\Jeopardy_Theme_light.mp3">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Media\Jeopardy_Theme_retro.wav"> <Content Include="Media\Jeopardy_Theme_retro.mp3">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
</ItemGroup> </ItemGroup>
......
...@@ -18,7 +18,7 @@ namespace Jeoparody ...@@ -18,7 +18,7 @@ namespace Jeoparody
string gameFilePath = "."; string gameFilePath = ".";
Game currentGame = null; Game currentGame = null;
SoundPlayer player = new SoundPlayer(); WMPLib.WindowsMediaPlayer player = new WMPLib.WindowsMediaPlayer();
private Assets assets = new Assets(); private Assets assets = new Assets();
public MainWindow() public MainWindow()
...@@ -26,10 +26,9 @@ namespace Jeoparody ...@@ -26,10 +26,9 @@ namespace Jeoparody
InitializeComponent(); InitializeComponent();
InitializeAssets(); InitializeAssets();
player.SoundLocation = assets.JeopardyThemePath; player.URL = "media/Jeopardy_Theme_retro.mp3";
player.Load(); player.controls.play();
player.Play();
gameFilePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); gameFilePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
gameFileName = Path.Combine(gameFilePath, gameFileName); gameFileName = Path.Combine(gameFilePath, gameFileName);
...@@ -149,7 +148,7 @@ namespace Jeoparody ...@@ -149,7 +148,7 @@ namespace Jeoparody
currentGame.players[4] = new Player("Public"); currentGame.players[4] = new Player("Public");
currentGame.players[5] = new Player("No one"); currentGame.players[5] = new Player("No one");
player.Stop(); player.controls.stop();
Board board = new Board(currentGame, assets); Board board = new Board(currentGame, assets);
board.ShowDialog(); board.ShowDialog();
......
...@@ -29,7 +29,7 @@ namespace Jeoparody ...@@ -29,7 +29,7 @@ namespace Jeoparody
bool hintShown = false; bool hintShown = false;
static SpeechSynthesizer synthesizer = new SpeechSynthesizer(); static SpeechSynthesizer synthesizer = new SpeechSynthesizer();
SoundPlayer player = new SoundPlayer(); WMPLib.WindowsMediaPlayer player = new WMPLib.WindowsMediaPlayer();
public QuestionView(Category category, int score, QuizItem item, Game currentGame, Assets assets) public QuestionView(Category category, int score, QuizItem item, Game currentGame, Assets assets)
{ {
...@@ -38,9 +38,8 @@ namespace Jeoparody ...@@ -38,9 +38,8 @@ namespace Jeoparody
InitializeComponent(); InitializeComponent();
player.SoundLocation = assets.JeopardyLightPath; player.URL = "media/Jeopardy_Theme_light.mp3";
player.Load(); player.controls.play();
player.Play();
if (item.imageFilename == "") if (item.imageFilename == "")
imageAnswer.Visibility = Visibility.Hidden; imageAnswer.Visibility = Visibility.Hidden;
...@@ -118,7 +117,7 @@ namespace Jeoparody ...@@ -118,7 +117,7 @@ namespace Jeoparody
if (activePlayer != 0) // ignore pressing if a player is selected currently for a question if (activePlayer != 0) // ignore pressing if a player is selected currently for a question
return; return;
player.Stop(); player.controls.stop();
// check for button 1-4 by players: // check for button 1-4 by players:
if ((e.Key == Key.D1) || (e.Key == Key.A)) if ((e.Key == Key.D1) || (e.Key == Key.A))
...@@ -202,13 +201,13 @@ namespace Jeoparody ...@@ -202,13 +201,13 @@ namespace Jeoparody
questionTotalMillisecondsPassedUntilHint = 0; questionTotalMillisecondsPassedUntilHint = 0;
progressBarLengthSeconds = item.seconds2hint; progressBarLengthSeconds = item.seconds2hint;
hintTimer.Start(); hintTimer.Start();
player.Play(); player.controls.play();
} }
private void textBlockPlayer5_MouseDown(object sender, MouseButtonEventArgs e) private void textBlockPlayer5_MouseDown(object sender, MouseButtonEventArgs e)
{ {
MessageBoxCustom.Show("Richtig :-)\nDie Frage lautet:\n\"" + item.question + "\""); MessageBoxCustom.Show("Richtig :-)\nDie Frage lautet:\n\"" + item.question + "\"");
player.Stop(); player.controls.stop();
playerAnswered = 5; playerAnswered = 5;
hintTimer.Stop(); hintTimer.Stop();
...@@ -218,7 +217,7 @@ namespace Jeoparody ...@@ -218,7 +217,7 @@ namespace Jeoparody
private void textBlockPlayer6_MouseDown(object sender, MouseButtonEventArgs e) private void textBlockPlayer6_MouseDown(object sender, MouseButtonEventArgs e)
{ {
MessageBoxCustom.Show("War es zu schwer? Frage wäre gewesen: \n\"" + item.question + "\""); MessageBoxCustom.Show("War es zu schwer? Frage wäre gewesen: \n\"" + item.question + "\"");
player.Stop(); player.controls.stop();
playerAnswered = 6; playerAnswered = 6;
hintTimer.Stop(); hintTimer.Stop();
......
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net48</TargetFramework> <TargetFramework>net461</TargetFramework>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
</PropertyGroup> </PropertyGroup>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment