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 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Kategroievorschlaege.txt" />
<Content Include="Media\Jeopardy_Theme_light.m4a">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Media\Jeopardy_Theme_light.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Media\Jeopardy_Theme_retro.m4a">
</ItemGroup>
<ItemGroup>
<COMReference Include="WMPLib">
<Guid>{6BF52A50-394A-11D3-B153-00C04F79FAA6}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<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>
</Content>
<Content Include="Media\Jeopardy_Theme_retro.wav">
<Content Include="Media\Jeopardy_Theme_retro.mp3">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
......
......@@ -18,7 +18,7 @@ namespace Jeoparody
string gameFilePath = ".";
Game currentGame = null;
SoundPlayer player = new SoundPlayer();
WMPLib.WindowsMediaPlayer player = new WMPLib.WindowsMediaPlayer();
private Assets assets = new Assets();
public MainWindow()
......@@ -26,10 +26,9 @@ namespace Jeoparody
InitializeComponent();
InitializeAssets();
player.SoundLocation = assets.JeopardyThemePath;
player.Load();
player.Play();
player.URL = "media/Jeopardy_Theme_retro.mp3";
player.controls.play();
gameFilePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
gameFileName = Path.Combine(gameFilePath, gameFileName);
......@@ -149,7 +148,7 @@ namespace Jeoparody
currentGame.players[4] = new Player("Public");
currentGame.players[5] = new Player("No one");
player.Stop();
player.controls.stop();
Board board = new Board(currentGame, assets);
board.ShowDialog();
......
......@@ -29,7 +29,7 @@ namespace Jeoparody
bool hintShown = false;
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)
{
......@@ -38,9 +38,8 @@ namespace Jeoparody
InitializeComponent();
player.SoundLocation = assets.JeopardyLightPath;
player.Load();
player.Play();
player.URL = "media/Jeopardy_Theme_light.mp3";
player.controls.play();
if (item.imageFilename == "")
imageAnswer.Visibility = Visibility.Hidden;
......@@ -118,7 +117,7 @@ namespace Jeoparody
if (activePlayer != 0) // ignore pressing if a player is selected currently for a question
return;
player.Stop();
player.controls.stop();
// check for button 1-4 by players:
if ((e.Key == Key.D1) || (e.Key == Key.A))
......@@ -202,13 +201,13 @@ namespace Jeoparody
questionTotalMillisecondsPassedUntilHint = 0;
progressBarLengthSeconds = item.seconds2hint;
hintTimer.Start();
player.Play();
player.controls.play();
}
private void textBlockPlayer5_MouseDown(object sender, MouseButtonEventArgs e)
{
MessageBoxCustom.Show("Richtig :-)\nDie Frage lautet:\n\"" + item.question + "\"");
player.Stop();
player.controls.stop();
playerAnswered = 5;
hintTimer.Stop();
......@@ -218,7 +217,7 @@ namespace Jeoparody
private void textBlockPlayer6_MouseDown(object sender, MouseButtonEventArgs e)
{
MessageBoxCustom.Show("War es zu schwer? Frage wäre gewesen: \n\"" + item.question + "\"");
player.Stop();
player.controls.stop();
playerAnswered = 6;
hintTimer.Stop();
......
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<TargetFramework>net461</TargetFramework>
<IsPackable>false</IsPackable>
</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