ektoplayer 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df13d5e7cb639805cb5a974d6c6e139026080839
4
- data.tar.gz: fe7d880c84897d5ab4543af17438ea6edcd214b8
3
+ metadata.gz: 44752ed0ce943af8aeba6ed7af645b94e40b9a8a
4
+ data.tar.gz: b5796fa336978ab5c8c72fb3a6c732084aee5575
5
5
  SHA512:
6
- metadata.gz: 24bf8f5c2f04a43862146b218493716196c29cd4646f0c0db21d79786249178c6a89993975e68660a245265f548efdb5c1aaaf87eaa82862e50f9b873f173b20
7
- data.tar.gz: 7bee87109a42bcb4e06be0ea4d50bc1f19243ab315494598fe5f6e540dd874f034e491f6f12f26d38f1fdc05004426757fa8d5c038862fd4f6499786b3d54fb5
6
+ metadata.gz: 268d0f386b0db1fb392c47ed61c3e1d7e16599776dd7d03e001b769ccd9e6b5cdd982d3fcb0d68796907e489708034765876c21d76c8df77a1f7496ebd201911
7
+ data.tar.gz: 9f30c21d456766c06d9e9c9d23f9a0f6a3cf4d773430b0f45ba521784fdf577eee89d85bb543f5d9bc4ee4f17bf0402387f3887ae98d40b4f0ec9a96d9e7781e
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ektoplayer
2
2
 
3
- Ektoplayer is a console audio player for [ektplazm.com](http://www.ektoplazm.com).
3
+ Ektoplayer is a console audio player for [ektoplazm.com](http://www.ektoplazm.com).
4
4
 
5
5
  ![Screenshot 2017-03-16](http://pixelbanane.de/yafu/118231024/ekto1.png)
6
6
  ![Screenshot 2017-03-16](http://pixelbanane.de/yafu/324630271/ekto2.png)
@@ -10,6 +10,7 @@ Ektoplayer is a console audio player for [ektplazm.com](http://www.ektoplazm.com
10
10
  * Ruby (1.9)
11
11
  * Portaudio (19)
12
12
  * Mpg123 (1.14)
13
+ * LibZip
13
14
  * Sqlite3
14
15
 
15
16
  ## Installation
@@ -19,12 +20,12 @@ library to compile the native extensions.
19
20
 
20
21
  ### Arch Linux
21
22
 
22
- pacman -S portaudio mpg123 ncurses ruby sqlite
23
+ pacman -S ruby portaudio mpg123 sqlite3 ncurses zlib base-devel --needed
23
24
  gem install ektoplayer
24
25
 
25
26
  ### Debian / Ubuntu (not yet tested)
26
27
 
27
- apt-get install portaudio19-dev libmpg123-dev libncurses-dev ruby1.9.1-dev sqlite-??
28
+ apt-get install ruby ruby-dev portaudio19-dev libmpg123-dev sqlite3 libsqlite3-dev libncurses-dev libz1g-dev build-essential
28
29
  gem install ektoplayer
29
30
 
30
31
  ## Features
@@ -32,7 +33,7 @@ library to compile the native extensions.
32
33
  * Listen to ektoplazm tracks
33
34
  * Download whole albums
34
35
  * Browse database by tags
35
- * Vi keybindings (`hjkl`, `^d`, `^u`, `/`, `?`, `n`, `N`, `:`, ...)
36
+ * Vi keybindings (`hjkl`, `^d`, `^u`, `/`, `?`, `n`, `N`, ...)
36
37
  * Mouse is supported
37
38
  * Supports 256/16/mono colors
38
39
  * Local sound file cache and download archive
@@ -1,7 +1,7 @@
1
1
  require 'fileutils'
2
2
  require 'date'
3
3
 
4
- { '.' => %w(config theme bindings client common ui),
4
+ { '.' => %w(compat config theme bindings client common ui),
5
5
  'views' => %w(mainwindow),
6
6
  'models' => %w(player browser playlist database trackloader),
7
7
  'operations' => %w(operations player browser playlist),
@@ -10,7 +10,7 @@ require 'date'
10
10
 
11
11
  module Ektoplayer
12
12
  class Application
13
- VERSION = '0.1.1'.freeze
13
+ VERSION = '0.1.2'.freeze
14
14
  GITHUB_URL = 'https://github.com/braph/ektoplayer'.freeze
15
15
  EKTOPLAZM_URL = 'http://www.ektoplazm.com'.freeze
16
16
 
@@ -141,7 +141,7 @@ module Ektoplayer
141
141
  UI::Input.start_loop
142
142
  end
143
143
  rescue
144
- puts "Error: #{e}"
144
+ puts "Error: #{$!}"
145
145
  Application.log(self, $!)
146
146
  end
147
147
  end
@@ -70,84 +70,84 @@ module Ektoplayer
70
70
 
71
71
  @bindings = {
72
72
  global: {
73
- 'splash.show': [?`, ?^ ],
74
- 'playlist.show': [?1 ],
75
- 'browser.show': [?2 ],
76
- 'info.show': [?3 ],
77
- 'help.show': [?4 ],
78
-
79
- 'playinginfo.toggle': [ Curses::KEY_F2 ],
80
- 'progressbar.toggle': [ Curses::KEY_F3 ],
81
- 'volumemeter.toggle': [ Curses::KEY_F4 ],
82
-
83
- 'player.forward': [?f, Curses::KEY_RIGHT ],
84
- 'player.backward': [?b, Curses::KEY_LEFT ],
85
- 'player.stop': [?s ],
86
- 'player.toggle': [?p ],
87
-
88
- 'playlist.play_next': [?> ],
89
- 'playlist.play_prev': [?< ],
90
-
91
- 'tabs.next': [?l ],
92
- 'tabs.prev': [?h ],
93
-
94
- quit: [?q ],
95
- refresh: ['^l' ],
96
- reload: ['^r' ],
97
- update: [?U ]},
73
+ :'splash.show' => [?`, ?^ ],
74
+ :'playlist.show' => [?1 ],
75
+ :'browser.show' => [?2 ],
76
+ :'info.show' => [?3 ],
77
+ :'help.show' => [?4 ],
78
+
79
+ :'playinginfo.toggle' => [ Curses::KEY_F2 ],
80
+ :'progressbar.toggle' => [ Curses::KEY_F3 ],
81
+ :'volumemeter.toggle' => [ Curses::KEY_F4 ],
82
+
83
+ :'player.forward' => [?f, Curses::KEY_RIGHT ],
84
+ :'player.backward' => [?b, Curses::KEY_LEFT ],
85
+ :'player.stop' => [?s ],
86
+ :'player.toggle' => [?p ],
87
+
88
+ :'playlist.play_next' => [?> ],
89
+ :'playlist.play_prev' => [?< ],
90
+
91
+ :'tabs.next' => [?l ],
92
+ :'tabs.prev' => [?h ],
93
+
94
+ :quit => [?q ],
95
+ :refresh => ['^l' ],
96
+ :reload => ['^r' ],
97
+ :update => [?U ]},
98
98
  playlist: {
99
99
  # movement
100
- 'playlist.top': [?g, Curses::KEY_HOME ],
101
- 'playlist.bottom': [?G, Curses::KEY_END ],
102
- 'playlist.up': [?k, Curses::KEY_UP ],
103
- 'playlist.down': [?j, Curses::KEY_DOWN ],
104
- 'playlist.page_down': ['^d', Curses::KEY_NPAGE ],
105
- 'playlist.page_up': ['^u', Curses::KEY_PPAGE ],
100
+ :'playlist.top' => [?g, Curses::KEY_HOME ],
101
+ :'playlist.bottom' => [?G, Curses::KEY_END ],
102
+ :'playlist.up' => [?k, Curses::KEY_UP ],
103
+ :'playlist.down' => [?j, Curses::KEY_DOWN ],
104
+ :'playlist.page_down' => ['^d', Curses::KEY_NPAGE ],
105
+ :'playlist.page_up' => ['^u', Curses::KEY_PPAGE ],
106
106
  # search
107
- 'playlist.search_next': [?n ],
108
- 'playlist.search_prev': [?N ],
109
- 'playlist.search_up': [?? ],
110
- 'playlist.search_down': [?/ ],
107
+ :'playlist.search_next' => [?n ],
108
+ :'playlist.search_prev' => [?N ],
109
+ :'playlist.search_up' => [?? ],
110
+ :'playlist.search_down' => [?/ ],
111
111
  # playlist
112
- 'playlist.play': [ Curses::KEY_ENTER ],
113
- 'playlist.download_album': [?$ ],
114
- 'playlist.reload': [?r ],
115
- 'playlist.goto_current': [?o ],
116
- 'playlist.clear': [?c ],
117
- 'playlist.delete': [?d ],
112
+ :'playlist.play' => [ Curses::KEY_ENTER ],
113
+ :'playlist.download_album' => [?$ ],
114
+ :'playlist.reload' => [?r ],
115
+ :'playlist.goto_current' => [?o ],
116
+ :'playlist.clear' => [?c ],
117
+ :'playlist.delete' => [?d ],
118
118
  # other
119
- 'player.toggle': [' ' ]},
119
+ :'player.toggle' => [' ' ]},
120
120
  browser: {
121
121
  # movement
122
- 'browser.top': [?g, Curses::KEY_HOME ],
123
- 'browser.bottom': [?G, Curses::KEY_END ],
124
- 'browser.up': [?k, Curses::KEY_UP ],
125
- 'browser.down': [?j, Curses::KEY_DOWN ],
126
- 'browser.page_up': ['^u', Curses::KEY_PPAGE ],
127
- 'browser.page_down': ['^d', Curses::KEY_NPAGE ],
122
+ :'browser.top' => [?g, Curses::KEY_HOME ],
123
+ :'browser.bottom' => [?G, Curses::KEY_END ],
124
+ :'browser.up' => [?k, Curses::KEY_UP ],
125
+ :'browser.down' => [?j, Curses::KEY_DOWN ],
126
+ :'browser.page_up' => ['^u', Curses::KEY_PPAGE ],
127
+ :'browser.page_down' => ['^d', Curses::KEY_NPAGE ],
128
128
  # search
129
- 'browser.search_next': [?n ],
130
- 'browser.search_prev': [?N ],
131
- 'browser.search_up': [?? ],
132
- 'browser.search_down': [?/ ],
129
+ :'browser.search_next' => [?n ],
130
+ :'browser.search_prev' => [?N ],
131
+ :'browser.search_up' => [?? ],
132
+ :'browser.search_down' => [?/ ],
133
133
  # browser
134
- 'browser.add_to_playlist': [' ', ?a ],
135
- 'browser.enter': [?E, Curses::KEY_ENTER ],
136
- 'browser.back': [?b, Curses::KEY_BACKSPACE ]},
134
+ :'browser.add_to_playlist' => [' ', ?a ],
135
+ :'browser.enter' => [?E, Curses::KEY_ENTER ],
136
+ :'browser.back' => [?b, Curses::KEY_BACKSPACE ]},
137
137
  help: {
138
- 'help.top': [?g, Curses::KEY_HOME ],
139
- 'help.bottom': [?G, Curses::KEY_END ],
140
- 'help.up': [?k, Curses::KEY_UP ],
141
- 'help.down': [?j, Curses::KEY_DOWN ],
142
- 'help.page_up': ['^u', Curses::KEY_PPAGE ],
143
- 'help.page_down': ['^d', Curses::KEY_NPAGE ]},
138
+ :'help.top' => [?g, Curses::KEY_HOME ],
139
+ :'help.bottom' => [?G, Curses::KEY_END ],
140
+ :'help.up' => [?k, Curses::KEY_UP ],
141
+ :'help.down' => [?j, Curses::KEY_DOWN ],
142
+ :'help.page_up' => ['^u', Curses::KEY_PPAGE ],
143
+ :'help.page_down' => ['^d', Curses::KEY_NPAGE ]},
144
144
  info: {
145
- 'info.top': [?g, Curses::KEY_HOME ],
146
- 'info.bottom': [?G, Curses::KEY_END ],
147
- 'info.up': [?k, Curses::KEY_UP ],
148
- 'info.down': [?j, Curses::KEY_DOWN ],
149
- 'info.page_up': ['^u', Curses::KEY_PPAGE ],
150
- 'info.page_down': ['^d', Curses::KEY_NPAGE ]},
145
+ :'info.top' => [?g, Curses::KEY_HOME ],
146
+ :'info.bottom' => [?G, Curses::KEY_END ],
147
+ :'info.up' => [?k, Curses::KEY_UP ],
148
+ :'info.down' => [?j, Curses::KEY_DOWN ],
149
+ :'info.page_up' => ['^u', Curses::KEY_PPAGE ],
150
+ :'info.page_down' => ['^d', Curses::KEY_NPAGE ]},
151
151
  splash: {}
152
152
  }
153
153
 
@@ -0,0 +1,23 @@
1
+ unless Array.public_method_defined? :sum
2
+ class Array
3
+ def sum
4
+ result = 0
5
+ self.each { |i| result += 1 }
6
+ result
7
+ end
8
+ end
9
+ end
10
+
11
+ unless Integer.public_method_defined? :clamp
12
+ class Integer
13
+ def clamp(min, max)
14
+ if self < min
15
+ min
16
+ elsif self > max
17
+ max
18
+ else
19
+ self
20
+ end
21
+ end
22
+ end
23
+ end
@@ -219,12 +219,12 @@ module Ektoplayer
219
219
 
220
220
  def parse(file, bindings, theme)
221
221
  callbacks = {
222
- 'set': self.method(:set),
223
- 'bind': bindings.method(:bind),
224
- 'unbind': bindings.method(:unbind),
225
- 'color': theme.method(:color),
226
- 'color_256': theme.method(:color_256),
227
- 'color_mono': theme.method(:color_mono)
222
+ set: self.method(:set),
223
+ bind: bindings.method(:bind),
224
+ unbind: bindings.method(:unbind),
225
+ color: theme.method(:color),
226
+ color_256: theme.method(:color_256),
227
+ color_mono: theme.method(:color_mono)
228
228
  }
229
229
  callbacks.default_proc = proc { |h,k| fail "unknown command: #{k}" }
230
230
  callbacks.freeze
@@ -7,65 +7,65 @@ module Ektoplayer
7
7
  def initialize
8
8
  @current = 0
9
9
  @theme = {
10
- 0 => { default: [-1, -1].freeze,
11
- 'url': [-1, -1, :underline ].freeze},
12
- 8 => { default: [-1, -1].freeze,
13
- 'url': [:magenta, -1, :underline].freeze,
14
-
15
- 'info.head': [:blue, -1, :bold ].freeze,
16
- 'info.tag': [:blue ].freeze,
17
- 'info.value': [:magenta ].freeze,
18
- 'info.description': [:blue ].freeze,
19
- 'info.download.file': [:blue ].freeze,
20
- 'info.download.percent': [:magenta, -1 ].freeze,
21
- 'info.download.error': [:red ].freeze,
22
-
23
- 'progressbar.progress': [:blue ].freeze,
24
- 'progressbar.rest': [:black ].freeze,
25
-
26
- 'volumemeter.level': [:magenta ].freeze,
27
- 'volumemeter.rest': [:black ].freeze,
28
-
29
- 'tabs': [:none ].freeze,
30
- 'tab_selected': [:blue ].freeze,
31
-
32
- 'list.item_even': [:blue ].freeze,
33
- 'list.item_odd': [:blue ].freeze,
34
-
35
- 'playinginfo.position': [:magenta ].freeze,
36
- 'playinginfo.state': [:cyan ].freeze,
37
-
38
- 'help.widget_name': [:blue, -1, :bold ].freeze,
39
- 'help.key_name': [:blue ].freeze,
40
- 'help.command_name': [:magenta ].freeze,
41
- 'help.command_desc': [:yellow ].freeze},
10
+ 0 => { default: [-1, -1].freeze,
11
+ :'url' => [-1, -1, :underline ].freeze},
12
+ 8 => { default: [-1, -1].freeze,
13
+ :'url' => [:magenta, -1, :underline].freeze,
14
+
15
+ :'info.head' => [:blue, -1, :bold ].freeze,
16
+ :'info.tag' => [:blue ].freeze,
17
+ :'info.value' => [:magenta ].freeze,
18
+ :'info.description' => [:blue ].freeze,
19
+ :'info.download.file' => [:blue ].freeze,
20
+ :'info.download.percent' => [:magenta, -1 ].freeze,
21
+ :'info.download.error' => [:red ].freeze,
22
+
23
+ :'progressbar.progress' => [:blue ].freeze,
24
+ :'progressbar.rest' => [:black ].freeze,
25
+
26
+ :'volumemeter.level' => [:magenta ].freeze,
27
+ :'volumemeter.rest' => [:black ].freeze,
28
+
29
+ :'tabs' => [:none ].freeze,
30
+ :'tab_selected' => [:blue ].freeze,
31
+
32
+ :'list.item_even' => [:blue ].freeze,
33
+ :'list.item_odd' => [:blue ].freeze,
34
+
35
+ :'playinginfo.position' => [:magenta ].freeze,
36
+ :'playinginfo.state' => [:cyan ].freeze,
37
+
38
+ :'help.widget_name' => [:blue, -1, :bold ].freeze,
39
+ :'help.key_name' => [:blue ].freeze,
40
+ :'help.command_name' => [:magenta ].freeze,
41
+ :'help.command_desc' => [:yellow ].freeze},
42
42
  256 => { default: [-1, -1].freeze,
43
- 'url': [97, -1, :underline ].freeze,
43
+ :'url' => [97, -1, :underline ].freeze,
44
44
 
45
- 'info.head': [32, -1, :bold ].freeze,
46
- 'info.tag': [74 ].freeze,
47
- 'info.value': [67 ].freeze,
48
- 'info.description': [67 ].freeze,
49
- 'info.download.file': [75 ].freeze,
50
- 'info.download.percent': [68 ].freeze,
51
- 'info.download.error': [:red ].freeze,
45
+ :'info.head' => [32, -1, :bold ].freeze,
46
+ :'info.tag' => [74 ].freeze,
47
+ :'info.value' => [67 ].freeze,
48
+ :'info.description' => [67 ].freeze,
49
+ :'info.download.file' => [75 ].freeze,
50
+ :'info.download.percent' => [68 ].freeze,
51
+ :'info.download.error' => [:red ].freeze,
52
52
 
53
- 'progressbar.progress': [23 ].freeze,
54
- 'progressbar.rest': [236 ].freeze,
53
+ :'progressbar.progress' => [23 ].freeze,
54
+ :'progressbar.rest' => [236 ].freeze,
55
55
 
56
- 'volumemeter.level': [:magenta ].freeze,
57
- 'volumemeter.rest': [236 ].freeze,
56
+ :'volumemeter.level' => [:magenta ].freeze,
57
+ :'volumemeter.rest' => [236 ].freeze,
58
58
 
59
- 'tabs': [250 ].freeze,
60
- 'tab_selected': [75 ].freeze,
59
+ :'tabs' => [250 ].freeze,
60
+ :'tab_selected' => [75 ].freeze,
61
61
 
62
- 'list.item_even': [:blue ].freeze,
63
- 'list.item_odd': [25 ].freeze,
62
+ :'list.item_even' => [:blue ].freeze,
63
+ :'list.item_odd' => [25 ].freeze,
64
64
 
65
- 'help.widget_name': [33 ].freeze,
66
- 'help.key_name': [75 ].freeze,
67
- 'help.command_name': [68 ].freeze,
68
- 'help.command_desc': [29 ].freeze}
65
+ :'help.widget_name' => [33 ].freeze,
66
+ :'help.key_name' => [75 ].freeze,
67
+ :'help.command_name' => [68 ].freeze,
68
+ :'help.command_desc' => [29 ].freeze}
69
69
  }.freeze
70
70
  end
71
71
 
@@ -68,7 +68,7 @@ module UI
68
68
  @@id += 1
69
69
  end
70
70
 
71
- Curses.init_pair(id, fg, bg) or fail
71
+ Curses.init_pair(id, fg, bg) #or fail
72
72
  Curses.color_pair(id)
73
73
  end
74
74
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ektoplayer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Abendroth
@@ -96,6 +96,7 @@ files:
96
96
  - lib/ektoplayer/browsepage.rb
97
97
  - lib/ektoplayer/client.rb
98
98
  - lib/ektoplayer/common.rb
99
+ - lib/ektoplayer/compat.rb
99
100
  - lib/ektoplayer/config.rb
100
101
  - lib/ektoplayer/controllers/browser.rb
101
102
  - lib/ektoplayer/controllers/controller.rb