soundcloud9000 0.1.0 → 0.1.1

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: fc1e32472f08a791aea41714cb6965266ab7fe62
4
- data.tar.gz: f36df4610ae1d4148015399eb4b0671b3b7eb90a
3
+ metadata.gz: c75677ab2dfb6f235a724717a31eb68509d5ac74
4
+ data.tar.gz: 3b2ed8c9459bffb301d89151fab20946eb6bdfb5
5
5
  SHA512:
6
- metadata.gz: e58fa0fa517f910a43e083a4fe6435ebda76a3e409f39ce4257473048b45f74d8ad2cff44b9361f256c1c502b9868a687633be8261694bef06e19c08ce2a3419
7
- data.tar.gz: 8d431bc98d51389dd2111fbdfb6d1ef9b95eaa20fb3204209d8a2030d4b4565f5d765547ffa700f88d3b8779d1c72cf85ab6f5f7def11ce61c64d5a831f50a84
6
+ metadata.gz: 070b6d1eaa479efac20187437245f0ab5baa5defc9bf5e8b1e35d1cfe5897877dbba8f858ffc453c3af2b4dc873c1048b37870988fa5d99747a60f7e02f65ea9
7
+ data.tar.gz: 772fc24cf1ab6715ae493070c9034f876c6e6de8e2307b306779225f39d90161a88b6a3c12a3d3e736cf1f6e3f41fd3a6b76ba998d76475a02c9b87372469007
data/.gitignore CHANGED
@@ -3,3 +3,4 @@
3
3
  *.log
4
4
  Gemfile.lock
5
5
  pkg/
6
+ *.gem
data/LICENSE CHANGED
@@ -4,4 +4,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
4
 
5
5
  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
6
 
7
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -2,16 +2,17 @@
2
2
 
3
3
  The next generation SoundCloud client. Without all these stupid CSS files. Runs on OSX and Linux.
4
4
 
5
- ![Screen Shot 2013-01-20 at 15 37 03](https://f.cloud.github.com/assets/3432/81282/06c44c7e-630f-11e2-9a91-85c9b917835c.png)
5
+ ![Screen Shot 2019-04-28 at 20 42 40](https://user-images.githubusercontent.com/31281983/56872460-74dd2780-69f7-11e9-9d7e-247757a9a6fd.png)
6
+
6
7
  ![Screen Shot 2013-01-20 at 15 37 54](https://f.cloud.github.com/assets/3432/81281/06b05df4-630f-11e2-8b55-7f3c18126831.png)
7
8
 
8
- This hack was built at the [Music Hack Day Stockholm 2013](http://stockholm.musichackday.org/2013).
9
+ This hack was originally built at the [Music Hack Day Stockholm 2013](http://stockholm.musichackday.org/2013).
9
10
 
10
11
  ## Requirements
11
12
 
12
- * Ruby (1.9)
13
- * Portaudio (19)
14
- * Mpg123 (1.14)
13
+ - Ruby (1.9)
14
+ - Portaudio (19)
15
+ - Mpg123 (1.14)
15
16
 
16
17
  ## Installation
17
18
 
@@ -20,46 +21,67 @@ library to compile the native extensions.
20
21
 
21
22
  ### OSX
22
23
 
23
- xcode-select --install
24
- brew install portaudio
25
- brew install mpg123
26
- gem install soundcloud9000
24
+ ```bash
25
+ xcode-select --install
26
+ brew install portaudio
27
+ brew install mpg123
28
+ gem install soundcloud9000
29
+ ```
30
+
31
+ If you ever encounter a problem with `audite` being `require`d, run:
32
+
33
+ ```bash
34
+ gem uninstall audite
35
+ gem install --user audite -- --with-ldflags="-lmpg123"
36
+ ```
37
+
38
+ See [this comment](https://github.com/grobie/soundcloud2000/issues/96#issuecomment-341915328) for more information.
27
39
 
28
40
  ### Debian / Ubuntu
29
41
 
30
- apt-get install portaudio19-dev libmpg123-dev libncurses-dev ruby1.9.1-dev
31
- gem install soundcloud9000
42
+ ```bash
43
+ apt-get install portaudio19-dev libmpg123-dev libncurses-dev ruby1.9.1-dev
44
+ gem install soundcloud9000
45
+ ```
32
46
 
33
47
  ## Usage
34
48
 
35
- In order to use soundcloud9000, you need to [acquire a client credential for your application](http://soundcloud.com/you/apps/new). soundcloud9000 expects a valid client id to be set in the SC_CLIENT_ID environment variable.
49
+ In order to use soundcloud9000, you need to [acquire a client credential for your application](https://stackoverflow.com/a/43962626/7127932). soundcloud9000 expects a valid client id to be set in the `SC_CLIENT_ID` environment variable.
36
50
 
37
- You can either set this up in your `.bashrc` or equivalent or you can specify it on the command line:
51
+ You can either set this up in your `.bashrc` or equivalent or you can specify it on the command line:
38
52
 
39
- SC_CLIENT_ID=YOUR_CLIENT_ID soundcloud9000
53
+ ```bash
54
+ SC_CLIENT_ID=YOUR_CLIENT_ID soundcloud9000
55
+ ```
40
56
 
41
57
  ## Features
42
58
 
43
- * stream SoundCloud tracks in your terminal (`enter`)
44
- * scroll through sound lists (`down` / `up`)
45
- * play / pause support (`space`)
46
- * forward / rewind support (`right` / `left`)
47
- * play tracks of different users (`u`)
48
- * play favorites from a user (`f`)
49
- * play sets/playlists from a user (`s`)
50
- * level meter
59
+ - stream SoundCloud tracks in your terminal (`enter`)
60
+ - scroll through sound lists (`down` / `up`)
61
+ - play / pause support (`space`)
62
+ - forward / rewind support (`right` / `left`)
63
+ - play tracks of different users (`u`)
64
+ - play favorites from a user (`f`)
65
+ - play sets/playlists from a user (`s`)
66
+ - level meter
51
67
 
52
68
  ## Planned
53
69
 
54
- * play any streams, sets or sounds
55
- * better browsing between users and sound lists
70
+ - play any streams, sets or sounds
71
+ - better browsing between users and sound lists
72
+ - shuffle
73
+ - live lyrics (don't get your hopes up for this one)
56
74
 
57
75
  ## Authors
58
76
 
59
- * [Matthias Georgi](https://github.com/georgi) ([@mgeorgi](https://twitter.com/mgeorgi))
60
- * [Tobias Schmidt](https://github.com/grobie) ([@dagrobie](https://twitter.com/dagrobie))
77
+ - [Matthias Georgi](https://github.com/georgi) ([@mgeorgi](https://twitter.com/mgeorgi))
78
+ - [Tobias Schmidt](https://github.com/grobie) ([@dagrobie](https://twitter.com/dagrobie))
61
79
 
62
80
  ## Contributors
63
81
 
64
- * [Travis Thieman](https://github.com/tthieman) ([@tthieman](https://twitter.com/thieman))
65
- * [Sean Lewis](https://github.com/sophisticasean) ([@FricSean](https://twitter.com/fricsean))
82
+ - [Travis Thieman](https://github.com/tthieman) ([@tthieman](https://twitter.com/thieman))
83
+ - [Sean Lewis](https://github.com/sophisticasean) ([@FricSean](https://twitter.com/fricsean))
84
+
85
+ ## Current Maintainer
86
+
87
+ - [Sumanth Ratna](https://github.com/sumanthratna) ([@sumanthratna](https://twitter.com/sumanthratna))
@@ -27,16 +27,16 @@ module Soundcloud9000
27
27
  Splash.new(
28
28
  UI::Rect.new(0, 0, Curses.cols, Curses.lines)))
29
29
 
30
- @player_controller = PlayerController.new(
31
- PlayerView.new(
32
- UI::Rect.new(0, 0, Curses.cols, 5)), client)
33
-
34
30
  @track_controller = TrackController.new(
35
31
  TracksTable.new(
36
32
  UI::Rect.new(0, 5, Curses.cols, Curses.lines - 5)), client)
37
33
 
38
34
  @track_controller.bind_to(TrackCollection.new(client))
39
35
 
36
+ @player_controller = PlayerController.new(
37
+ PlayerView.new(
38
+ UI::Rect.new(0, 0, Curses.cols, 5)), client)
39
+
40
40
  @track_controller.events.on(:select) do |track|
41
41
  @player_controller.play(track)
42
42
  end
@@ -73,7 +73,7 @@ module Soundcloud9000
73
73
  case key
74
74
  when :left, :right, :space, :one, :two, :three, :four, :five, :six, :seven, :eight, :nine
75
75
  @player_controller.events.trigger(:key, key)
76
- when :down, :up, :enter, :u, :f, :s, :j, :k
76
+ when :down, :up, :enter, :u, :f, :s, :j, :k, :m
77
77
  @track_controller.events.trigger(:key, key)
78
78
  end
79
79
  end
@@ -52,6 +52,10 @@ module Soundcloud9000
52
52
  @tracks.clear_and_replace
53
53
  end
54
54
  end
55
+ # when :im grown up, im gonna go to brown and be smarter than u, sumanth <333 (Rahel Selemon, April 29, 2019)
56
+ when :m
57
+ @tracks.shuffle = !@tracks.shuffle
58
+ UI::Input.message("Shuffle #{if @tracks.shuffle then "enabled" else "disabled" end}.")
55
59
  end
56
60
  end
57
61
  end
@@ -81,7 +85,11 @@ module Soundcloud9000
81
85
  end
82
86
 
83
87
  def next_track
84
- @view.down
88
+ if @tracks.shuffle
89
+ @view.random
90
+ else
91
+ @view.down
92
+ end
85
93
  @view.select
86
94
  events.trigger(:select, current_track)
87
95
  end
@@ -10,12 +10,13 @@ module Soundcloud9000
10
10
  DEFAULT_LIMIT = 50
11
11
 
12
12
  attr_reader :limit
13
- attr_accessor :collection_to_load, :user, :playlist
13
+ attr_accessor :collection_to_load, :user, :playlist, :shuffle
14
14
 
15
15
  def initialize(client)
16
16
  super
17
17
  @limit = DEFAULT_LIMIT
18
18
  @collection_to_load = :recent
19
+ @shuffle = false
19
20
  end
20
21
 
21
22
  def size
@@ -26,7 +26,8 @@ module Soundcloud9000
26
26
  '7' => :seven,
27
27
  '8' => :eight,
28
28
  '9' => :nine,
29
- 'f' => :f
29
+ 'f' => :f,
30
+ 'm' => :m
30
31
  }
31
32
 
32
33
  def self.get(delay = 0)
@@ -46,6 +47,12 @@ module Soundcloud9000
46
47
  result
47
48
  end
48
49
 
50
+ def self.message(output)
51
+ Curses.setpos(Curses.lines - 1, 0)
52
+ Curses.clrtoeol
53
+ Curses.addstr(output)
54
+ end
55
+
49
56
  def self.error(output)
50
57
  Curses.setpos(Curses.lines - 1, 0)
51
58
  Curses.clrtoeol
@@ -57,6 +57,13 @@ module Soundcloud9000
57
57
  end
58
58
  end
59
59
 
60
+ def random
61
+ @current = rand(length)
62
+ @top -= 1 if @current < @top
63
+ @top += 1 if @current > body_height
64
+ render
65
+ end
66
+
60
67
  def select
61
68
  @selected = @current
62
69
  render
@@ -1,5 +1,6 @@
1
1
  require_relative '../time_helper'
2
2
  require_relative '../ui/view'
3
+ require_relative '../models/track_collection'
3
4
 
4
5
  module Soundcloud9000
5
6
  module Views
@@ -22,6 +23,7 @@ module Soundcloud9000
22
23
 
23
24
  def draw
24
25
  line progress + download_progress
26
+ # p @tracks
25
27
  with_color(:green) do
26
28
  line((duration + ' - ' + status).ljust(16) + @player.title)
27
29
  end
@@ -30,7 +32,7 @@ module Soundcloud9000
30
32
  end
31
33
 
32
34
  def status
33
- @player.playing? ? 'playing' : 'paused'
35
+ (@player.playing? ? 'playing' : 'paused') # + ' ' + (@tracks.shuffle? ? '(shuffle)' : '')
34
36
  end
35
37
 
36
38
  def progress
@@ -2,7 +2,7 @@ $:.push File.expand_path("../lib", __FILE__)
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "soundcloud9000"
5
- s.version = "0.1.0"
5
+ s.version = "0.1.1"
6
6
  s.authors = ["Tobias Schmidt", "Matthias Georgi", "Sumanth Ratna"]
7
7
  s.email = "sratna@sumanthratna.gq"
8
8
  s.homepage = "http://www.github.com/sumanthratna/soundcloud9000"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soundcloud9000
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Schmidt
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-04-29 00:00:00.000000000 Z
13
+ date: 2019-04-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json