aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/c_go2work.go5
-rw-r--r--src/c_player.go17
2 files changed, 12 insertions, 10 deletions
diff --git a/src/c_go2work.go b/src/c_go2work.go
index 0b8e4f9..3b4e4a3 100644
--- a/src/c_go2work.go
+++ b/src/c_go2work.go
@@ -54,13 +54,14 @@ import (
func main() {
t := get_time()
- ticker := time.NewTicker(1 * time.Second)
+ ticker := time.NewTicker(2 * time.Second)
quit := make(chan struct{})
fmt.Println("Time is: " + t)
+ exec_player("mpv", "/home/jozan/mu/rock/grunge/nirvana/1993_in_utero/04_rape_me.flac")
for {
select {
case <- ticker.C:
- exec_player("/home/jozan/mu/rock/grunge/nirvana/1993_in_utero/04_rape_me.flac")
+ exec_player("mpv", "/home/jozan/mu/rock/grunge/nirvana/1993_in_utero/04_rape_me.flac")
case <- quit:
ticker.Stop()
return
diff --git a/src/c_player.go b/src/c_player.go
index 539fe9c..399f90e 100644
--- a/src/c_player.go
+++ b/src/c_player.go
@@ -49,15 +49,16 @@ package main
import (
"fmt"
- "log"
+ // "log"
"os/exec"
)
-func exec_player(file string) {
- fmt.Println("Playing: " + file)
- cmd := exec.Command("mpv", "--really-quiet", file)
- err := cmd.Run();
- if err != nil {
- log.Fatal(err)
- }
+func exec_player(args ...string) {
+ fmt.Println("Playing: " + args[len(args) - 1])
+ cmd := exec.Command(args)
+ // cmd := exec.Command("mpv", file)
+ // err := cmd.Run();
+ // if err != nil {
+ // log.Fatal(err)
+ // }
}