Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Thick-Common
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
潘栩锋
Thick-Common
Commits
ceaf9a32
Commit
ceaf9a32
authored
Feb 27, 2020
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug 报警声 文件没有,会出错
parent
c48adad7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
16 deletions
+29
-16
Window_WarningTip.xaml
....ControlLibrary/FLY.ControlLibrary/Window_WarningTip.xaml
+1
-1
Window_WarningTip.xaml.cs
...ntrolLibrary/FLY.ControlLibrary/Window_WarningTip.xaml.cs
+28
-15
No files found.
Project.FLY.ControlLibrary/FLY.ControlLibrary/Window_WarningTip.xaml
View file @
ceaf9a32
Project.FLY.ControlLibrary/FLY.ControlLibrary/Window_WarningTip.xaml.cs
View file @
ceaf9a32
...
@@ -45,6 +45,7 @@ namespace FLY.ControlLibrary
...
@@ -45,6 +45,7 @@ namespace FLY.ControlLibrary
/// </summary>
/// </summary>
public
string
OKContent
{
get
;
set
;
}
=
"确定"
;
public
string
OKContent
{
get
;
set
;
}
=
"确定"
;
public
Window_WarningTip
()
public
Window_WarningTip
()
{
{
InitializeComponent
();
InitializeComponent
();
...
@@ -74,7 +75,7 @@ namespace FLY.ControlLibrary
...
@@ -74,7 +75,7 @@ namespace FLY.ControlLibrary
/// </summary>
/// </summary>
public
static
void
Stop
()
public
static
void
Stop
()
{
{
Current
?.
timer1_Tick
(
null
,
null
);
Current
?.
timer1_Tick
(
null
,
null
);
}
}
/// <summary>
/// <summary>
/// 关闭
/// 关闭
...
@@ -90,15 +91,22 @@ namespace FLY.ControlLibrary
...
@@ -90,15 +91,22 @@ namespace FLY.ControlLibrary
{
{
isRunning
=
false
;
isRunning
=
false
;
outputDevice
?.
Stop
();
outputDevice
?.
Stop
();
outputDevice
.
Dispose
();
outputDevice
?
.
Dispose
();
outputDevice
=
null
;
outputDevice
=
null
;
audioFile
.
Dispose
();
audioFile
?
.
Dispose
();
audioFile
=
null
;
audioFile
=
null
;
}
}
void
playMusic
(
string
musicpath
)
void
playMusic
(
string
musicpath
)
{
try
{
{
audioFile
=
new
AudioFileReader
(
musicpath
);
audioFile
=
new
AudioFileReader
(
musicpath
);
}
catch
{
//音乐无法启动
return
;
}
outputDevice
=
new
WaveOutEvent
();
outputDevice
=
new
WaveOutEvent
();
...
@@ -116,7 +124,12 @@ namespace FLY.ControlLibrary
...
@@ -116,7 +124,12 @@ namespace FLY.ControlLibrary
}
}
void
Play
(
string
musicpath
)
void
Play
(
string
musicpath
)
{
{
if
(
audioFile
==
null
)
if
(
musicpath
==
null
)
{
//没有音乐,关闭
stopMusic
();
}
else
if
(
audioFile
==
null
)
{
{
playMusic
(
musicpath
);
playMusic
(
musicpath
);
}
}
...
@@ -218,7 +231,7 @@ namespace FLY.ControlLibrary
...
@@ -218,7 +231,7 @@ namespace FLY.ControlLibrary
Current
.
Play
(
musicpath
);
Current
.
Play
(
musicpath
);
WarningTipID
++;
WarningTipID
++;
if
(
WarningTipID
>=
int
.
MaxValue
-
1
)
if
(
WarningTipID
>=
int
.
MaxValue
-
1
)
WarningTipID
=
0
;
WarningTipID
=
0
;
return
WarningTipID
;
return
WarningTipID
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment