radiovis-generator 0.1.1 → 1.0.0
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.
- data/README.md +2 -2
- data/lib/radiovis-generator.rb +8 -8
- data/lib/radiovis-generator/slide.rb +1 -1
- metadata +3 -3
data/README.md
CHANGED
@@ -43,12 +43,12 @@ gen = RadioVISGenerator::Generator.new
|
|
43
43
|
options = {
|
44
44
|
slides: [RadioVISGenerator::BrandingSlide.new, RadioVISGenerator::NowPlayingSlide.new],
|
45
45
|
url: 'http://localhost/radiovis/', # The path on your web server pointing at..
|
46
|
-
path: '/tmp/radiovis-output' # This path on your filesystem!
|
46
|
+
path: '/tmp/radiovis-output', # This path on your filesystem!
|
47
47
|
broadcast_parameters: 'fm/ecc/pi/freq', # See the RadioVIS spec for how to generate this.
|
48
48
|
username: 'system', # These details are for your Stomp broker.
|
49
49
|
password: 'manager',
|
50
50
|
host: 'localhost',
|
51
|
-
port:
|
51
|
+
port: 61613
|
52
52
|
}
|
53
53
|
gen.run(options)
|
54
54
|
```
|
data/lib/radiovis-generator.rb
CHANGED
@@ -27,7 +27,7 @@ module RadioVISGenerator
|
|
27
27
|
username: 'system',
|
28
28
|
password: 'manager',
|
29
29
|
host: 'localhost',
|
30
|
-
port:
|
30
|
+
port: 61613
|
31
31
|
}
|
32
32
|
options = defaults.merge(options)
|
33
33
|
raise ArgumentsError, "No slide instances provided!" unless options[:slides].size > 0
|
@@ -61,7 +61,7 @@ module RadioVISGenerator
|
|
61
61
|
image_topic = "/topic/#{options[:broadcast_parameters]}/image"
|
62
62
|
text_topic = "/topic/#{options[:broadcast_parameters]}/text"
|
63
63
|
image_message = "SHOW "+options[:url]+slide_output[:image_small]
|
64
|
-
text_message = "TEXT "+slide_output[:text]
|
64
|
+
text_message = "TEXT "+slide_output[:text][0..127]
|
65
65
|
puts "Publishing Stomp messages"
|
66
66
|
puts " - #{image_topic} <= #{image_message}"
|
67
67
|
puts " - #{text_topic} <= #{text_message}"
|
@@ -75,12 +75,12 @@ module RadioVISGenerator
|
|
75
75
|
sleep 1
|
76
76
|
end
|
77
77
|
end
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
78
|
+
rescue Exception => e
|
79
|
+
puts "Got exception #{e}!"
|
80
|
+
conn.disconnect rescue nil
|
81
|
+
conn = nil
|
82
|
+
sleep 5
|
83
|
+
retry
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
@@ -35,7 +35,7 @@ class RadioVISGenerator::Slide
|
|
35
35
|
|
36
36
|
# How long should we wait between redisplays if we've got nothing better to do (ie no content changed)?
|
37
37
|
def redisplay_delay
|
38
|
-
return
|
38
|
+
return 23
|
39
39
|
end
|
40
40
|
|
41
41
|
# What image makes the background of this slide, and should be composited over it?
|