Skip to content

Commit

Permalink
Bumping version to 0.16.25
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Dec 18, 2018
1 parent f8a2b03 commit 9d7b36d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 20 deletions.
2 changes: 1 addition & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release Notes

## 0.16.24 - 2018-12-18
## 0.16.25 - 2018-12-18
* Update to ASP.NET 2.2

## 0.15.11 - 2018-11-05
Expand Down
4 changes: 2 additions & 2 deletions src/Client/ReleaseNotes.fs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module internal ReleaseNotes

let Version = "0.16.24"
let Version = "0.16.25"

let IsPrerelease = false

let Notes = """
# Release Notes
## 0.16.24 - 2018-12-18
## 0.16.25 - 2018-12-18
* Update to ASP.NET 2.2
## 0.15.11 - 2018-11-05
Expand Down
18 changes: 5 additions & 13 deletions src/PiServer/Elmish.Audio.fs
Original file line number Diff line number Diff line change
Expand Up @@ -38,31 +38,25 @@ dbus-send --print-reply --session --reply-timeout=500 \
p.StartInfo <- startInfo
p.Start() |> ignore




[<RequireQualifiedAccess>]
module Program =

let withAudio stoppedMsg (program:Elmish.Program<_,_,_,_>) =
let mutable lastView = None
let mutable activelyKilled = false

let isActivelyKilled dispatch _args =
if not activelyKilled then
dispatch stoppedMsg
let sendMsg file dispatch _args =
dispatch (stoppedMsg file)

let play dispatch file volume =
let p = new System.Diagnostics.Process()
p.EnableRaisingEvents <- true
p.Exited.Add (isActivelyKilled dispatch)
p.Exited.Add (sendMsg file dispatch)

let startInfo = System.Diagnostics.ProcessStartInfo()
startInfo.FileName <- "omxplayer"
let volume = int (System.Math.Round(2000. * System.Math.Log10 volume))
startInfo.Arguments <- sprintf "--vol %d " volume + file
p.StartInfo <- startInfo
activelyKilled <- false
p.Start() |> ignore

let killMusikPlayer() = task {
Expand All @@ -73,10 +67,8 @@ module Program =
let startInfo = System.Diagnostics.ProcessStartInfo()
startInfo.FileName <- "sudo"
startInfo.Arguments <- "kill -9 " + p.Id.ToString()
killP.StartInfo <- startInfo
activelyKilled <- true
let _ = killP.Start()

killP.StartInfo <- startInfo
killP.Start() |> ignore
while not p.HasExited do
do! Task.Delay 10
with _ -> ()
Expand Down
20 changes: 16 additions & 4 deletions src/PiServer/PiServer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type Msg =
| Play of PlayList
| NextMediaFile
| PreviousMediaFile
| PlayerStopped of unit
| PlayerStopped of string
| FinishPlaylist of unit
| Noop of unit
| Err of exn
Expand Down Expand Up @@ -216,8 +216,20 @@ let update (msg:Msg) (model:Model) =
log.InfoFormat("Playing new PlayList with {0} files", playList.MediaFiles.Length)
model, Cmd.none

| PlayerStopped _ ->
model, Cmd.ofMsg NextMediaFile
| PlayerStopped file ->
match model.PlayList with
| Some playList ->
try
let current = playList.MediaFiles.[playList.Position]
if current = file then
model,Cmd.ofMsg NextMediaFile
else
model,Cmd.none
with
| _ ->
model,Cmd.none
| _ ->
model,Cmd.none

| NextMediaFile ->
match model.PlayList with
Expand Down Expand Up @@ -315,7 +327,7 @@ let view (model:Model) dispatch : Audio =
let app =
Program.mkProgram init update view
|> Program.withTrace (fun msg _model -> log.InfoFormat("{0}", msg))
|> Program.withAudio (PlayerStopped())
|> Program.withAudio (fun file -> PlayerStopped file)


Program.runWith nodeServices app
Expand Down

0 comments on commit 9d7b36d

Please sign in to comment.