kikeru 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5f0bad6a2d167f1b2d514d50d170c6a4c983d7ae
4
- data.tar.gz: 45607e8bab5adf20da83e37bc0776d2f110c4111
3
+ metadata.gz: 93ad2174a551ac38dd006fb95ca459f589b2a833
4
+ data.tar.gz: 8ef89e5ba2d051ecc870ac85ef0d99d855ee5e01
5
5
  SHA512:
6
- metadata.gz: 70a02927dda88679e36aec062cd3ff4a4d3798189e8b6dd805427694525d337850df16cf574c63e7898d353f32df5b6965bb5ca0e75fc12f2676a9bf292176d9
7
- data.tar.gz: 27fca698d68d751f4d1a8f37c86581984769fdfa7762a35ed45a6e0fb17e8f6006adbd8868f2ac066dd88256a1006bbe09069b0b871064438de889632983acf5
6
+ metadata.gz: 40150f9e23983cccd3e9a674516bc77eca18158ffa26344c1770d912610f0f45ed1e1add48f386c161d08e15bf574c39c6d2ac7950d3acb897b51cb3caa324dc
7
+ data.tar.gz: 7c60aabc655fbdbf90f41240233b7dab6e062f7c33b572076a668b3402870b0c3e654f520f1da894933c5c59d6ac4bb2f52ecc86ca7ad9a50fce5fd909366caa
data/README.md CHANGED
@@ -25,6 +25,7 @@ If no argument, then search current directory.
25
25
  p: prev
26
26
  r: restart
27
27
  q: quit
28
+ space: pause/play
28
29
 
29
30
  ## Contributing
30
31
 
@@ -38,8 +38,7 @@ module Kikeru
38
38
  window = Kikeru::Window.new
39
39
  window.add_container(file_container)
40
40
  window.show_all
41
- window.play
42
-
41
+ window.load
43
42
 
44
43
  Gtk.main
45
44
  end
@@ -97,6 +96,7 @@ Keybind:
97
96
  p: prev
98
97
  r: restart
99
98
  q: quit
99
+ space: pause/play
100
100
  EOM
101
101
  @logger.info(message)
102
102
  end
@@ -1,3 +1,3 @@
1
1
  module Kikeru
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -13,11 +13,11 @@ module Kikeru
13
13
  @file = @container.shift
14
14
  end
15
15
 
16
- def play
17
- @playbin.stop
16
+ def load
17
+ stop
18
18
  @playbin.uri = Gst.filename_to_uri(@file)
19
19
  self.title = File.basename(@file)
20
- @playbin.play
20
+ play
21
21
  end
22
22
 
23
23
  private
@@ -28,7 +28,7 @@ module Kikeru
28
28
 
29
29
  def setup_window
30
30
  signal_connect("destroy") do
31
- @playbin.stop
31
+ stop
32
32
  Gtk.main_quit
33
33
  end
34
34
 
@@ -36,15 +36,17 @@ module Kikeru
36
36
  case event.keyval
37
37
  when Gdk::Keyval::GDK_KEY_n
38
38
  @file = @container.shift(@file)
39
- play
39
+ load
40
40
  when Gdk::Keyval::GDK_KEY_p
41
41
  @file = @container.pop(@file)
42
- play
42
+ load
43
43
  when Gdk::Keyval::GDK_KEY_r
44
- play
44
+ load
45
45
  when Gdk::Keyval::GDK_KEY_q
46
- @playbin.stop
46
+ stop
47
47
  Gtk.main_quit
48
+ when Gdk::Keyval::GDK_KEY_space
49
+ toggle
48
50
  end
49
51
  end
50
52
  end
@@ -57,6 +59,34 @@ module Kikeru
57
59
  puts "'playbin' gstreamer plugin missing"
58
60
  exit(false)
59
61
  end
62
+
63
+ @playbin.bus.add_watch do |bus, message|
64
+ case message.type
65
+ when Gst::MessageType::EOS
66
+ @file = @container.shift(@file)
67
+ load
68
+ end
69
+ true
70
+ end
71
+ end
72
+
73
+ def play
74
+ @playbin.play
75
+ @playing = true
76
+ end
77
+
78
+ def pause
79
+ @playbin.pause
80
+ @playing = false
81
+ end
82
+
83
+ def stop
84
+ @playbin.stop
85
+ @playing = false
86
+ end
87
+
88
+ def toggle
89
+ @playing ? pause : play
60
90
  end
61
91
  end
62
92
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kikeru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masafumi Yokoyama
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-10 00:00:00.000000000 Z
11
+ date: 2013-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gtk3