rwdmpd 0.06
Sign up to get free protection for your applications and to get access to all the features.
- data/Readme.txt +475 -0
- data/bin/rwdmpd +19 -0
- data/code/01rwdcore/01rwdcore.rb +29 -0
- data/code/01rwdcore/02helptexthashbegin.rb +4 -0
- data/code/01rwdcore/03helptexthash.rb +23 -0
- data/code/01rwdcore/04helptextend.rb +6 -0
- data/code/01rwdcore/jumplinkcommand.rb +26 -0
- data/code/01rwdcore/openhelpwindow.rb +31 -0
- data/code/01rwdcore/returntomain.rb +10 -0
- data/code/01rwdcore/rundocuments.rb +10 -0
- data/code/01rwdcore/runeditconfiguration.rb +10 -0
- data/code/01rwdcore/runhelpabout.rb +10 -0
- data/code/01rwdcore/runopentinkerdocument.rb +7 -0
- data/code/01rwdcore/rwdtinkerversion.rb +22 -0
- data/code/01rwdcore/rwdwindowreturn.rb +9 -0
- data/code/01rwdcore/selectiontab.rb +9 -0
- data/code/01rwdcore/setuphelpaboutoptions.rb +13 -0
- data/code/01rwdcore/setuptinkerdocuments.rb +6 -0
- data/code/01rwdcore/test_cases.rb +109 -0
- data/code/01rwdcore/test_harness.rb +13 -0
- data/code/01rwdcore/uploadreturns.rb +62 -0
- data/code/dd0viewphoto/dd0viewphoto.rb +3 -0
- data/code/superant.com.rwdmp3/0uninstallapplet.rb +11 -0
- data/code/superant.com.rwdmp3/clearscreendisplay.rb +7 -0
- data/code/superant.com.rwdmp3/controlmpd.rb +139 -0
- data/code/superant.com.rwdmp3/helptexthashrwdmp3.rb +41 -0
- data/code/superant.com.rwdmp3/listplaylistfiles.rb +12 -0
- data/code/superant.com.rwdmp3/loadconfigurationrecord.rb +22 -0
- data/code/superant.com.rwdmp3/loadconfigurationvariables.rb +13 -0
- data/code/superant.com.rwdmp3/loadplaylistrecord.rb +19 -0
- data/code/superant.com.rwdmp3/mpd_client.rb +41 -0
- data/code/superant.com.rwdmp3/mpd_seek.rb +23 -0
- data/code/superant.com.rwdmp3/openhelpwindowrwdmp3.rb +25 -0
- data/code/superant.com.rwdmp3/runrwdmpdwindow.rb +10 -0
- data/code/superant.com.rwdmp3/rwdtinkerversion.rb +10 -0
- data/code/superant.com.rwdmp3/saveconfigurationrecord.rb +19 -0
- data/code/superant.com.rwdmp3/saveplaylistrecord.rb +18 -0
- data/code/superant.com.rwdmp3/startmp3server.rb +16 -0
- data/code/superant.com.rwdtinkerbackwindow/diagnostictab.rb +19 -0
- data/code/superant.com.rwdtinkerbackwindow/helptexthashtinkerwin2.rb +61 -0
- data/code/superant.com.rwdtinkerbackwindow/initiateapplets.rb +240 -0
- data/code/superant.com.rwdtinkerbackwindow/installgemapplet.rb +34 -0
- data/code/superant.com.rwdtinkerbackwindow/installremotegem.rb +20 -0
- data/code/superant.com.rwdtinkerbackwindow/listgemdirs.rb +12 -0
- data/code/superant.com.rwdtinkerbackwindow/listgemzips.rb +53 -0
- data/code/superant.com.rwdtinkerbackwindow/listinstalledfiles.rb +12 -0
- data/code/superant.com.rwdtinkerbackwindow/listzips.rb +33 -0
- data/code/superant.com.rwdtinkerbackwindow/loadconfigurationrecord.rb +22 -0
- data/code/superant.com.rwdtinkerbackwindow/loadconfigurationvariables.rb +14 -0
- data/code/superant.com.rwdtinkerbackwindow/network.rb +87 -0
- data/code/superant.com.rwdtinkerbackwindow/openappletname.rb +19 -0
- data/code/superant.com.rwdtinkerbackwindow/openhelpwindowtinkerwin2.rb +38 -0
- data/code/superant.com.rwdtinkerbackwindow/remotegemlist.rb +24 -0
- data/code/superant.com.rwdtinkerbackwindow/removeapplet.rb +46 -0
- data/code/superant.com.rwdtinkerbackwindow/removeappletvariables.rb +52 -0
- data/code/superant.com.rwdtinkerbackwindow/runremoteinstall.rb +11 -0
- data/code/superant.com.rwdtinkerbackwindow/runrwdtinkerbackwindow.rb +15 -0
- data/code/superant.com.rwdtinkerbackwindow/rwdtinkerwin2version.rb +13 -0
- data/code/superant.com.rwdtinkerbackwindow/saveconfigurationrecord.rb +19 -0
- data/code/superant.com.rwdtinkerbackwindow/viewappletcontents.rb +22 -0
- data/code/superant.com.rwdtinkerbackwindow/viewgemappletcontents.rb +24 -0
- data/code/zz0applicationend/zz0end.rb +4 -0
- data/configuration/language.dist +8 -0
- data/configuration/rwdapplicationidentity.dist +3 -0
- data/configuration/rwdtinker.dist +15 -0
- data/configuration/rwdwmpd-0.06.dist +14 -0
- data/configuration/tinkerwin2variables.dist +18 -0
- data/gui/00coreguibegin/applicationguitop.rwd +4 -0
- data/gui/frontwindow0/cc0openphoto.rwd +22 -0
- data/gui/frontwindowselections/00selectiontabbegin.rwd +11 -0
- data/gui/frontwindowselections/jumplinkcommands.rwd +15 -0
- data/gui/frontwindowselections/wwselectionend.rwd +3 -0
- data/gui/frontwindowtdocuments/00documentbegin.rwd +6 -0
- data/gui/frontwindowtdocuments/tinkerdocuments.rwd +14 -0
- data/gui/frontwindowtdocuments/zzdocumentend.rwd +8 -0
- data/gui/helpaboutbegin/zzzrwdlasttab.rwd +6 -0
- data/gui/helpaboutbegin/zzzzhelpscreenstart.rwd +3 -0
- data/gui/helpaboutbegin/zzzzzzhelpabouttab.rwd +15 -0
- data/gui/helpaboutzend/helpscreenend.rwd +3 -0
- data/gui/helpaboutzend/zhelpscreenstart2.rwd +3 -0
- data/gui/helpaboutzend/zzzzhelpabout2.rwd +15 -0
- data/gui/helpaboutzend/zzzzhelpscreen2end.rwd +3 -0
- data/gui/tinkerbackwindows/superant.com.rwdmp3/10appletbegin.rwd +4 -0
- data/gui/tinkerbackwindows/superant.com.rwdmp3/20rwdmpd.rwd +37 -0
- data/gui/tinkerbackwindows/superant.com.rwdmp3/25rwdseek.rwd +23 -0
- data/gui/tinkerbackwindows/superant.com.rwdmp3/30editplaylist.rwd +27 -0
- data/gui/tinkerbackwindows/superant.com.rwdmp3/88viewconfiguration.rwd +32 -0
- data/gui/tinkerbackwindows/superant.com.rwdmp3/89rwddiagnostics.rwd +26 -0
- data/gui/tinkerbackwindows/superant.com.rwdmp3/90jumplinkcommands.rwd +17 -0
- data/gui/tinkerbackwindows/superant.com.rwdmp3/9end.rwd +6 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/1appname.rwd +5 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/40rwdlistzips.rwd +41 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/45installremotezip.rwd +44 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/50rwdlistapplets.rwd +44 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/60editconfiguration.rwd +30 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/70rwddiagnostics.rwd +29 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/81jumplinkcommands.rwd +17 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/9backend.rwd +6 -0
- data/gui/tinkerbackwindows/superant.com.tinkerhelpwindow/1appname.rwd +31 -0
- data/gui/tinkerbackwindows/superant.com.tinkerhelpwindow/9end.rwd +4 -0
- data/gui/tinkerbackwindows/superant.com.versionwindow/1appname.rwd +19 -0
- data/gui/tinkerbackwindows/superant.com.versionwindow/helpaboutwindow.rwd +17 -0
- data/gui/zzcoreguiend/yy9rwdend.rwd +4 -0
- data/init.rb +277 -0
- data/installed/mpdmusicdata2.inf +2 -0
- data/installed/rwdwmpd-0.06.inf +10 -0
- data/installed/temp.rb +1 -0
- data/lang/en/rwdcore/languagefile.rb +58 -0
- data/lang/es/rwdcore/languagefile-es.rb +62 -0
- data/lang/fr/rwdcore/languagefile.rb +64 -0
- data/lang/jp/rwdcore/languagefile.rb +72 -0
- data/lang/nl/rwdcore/languagefile.rb +75 -0
- data/lib/librmpd.rb +1152 -0
- data/lib/mpdserver.rb +1204 -0
- data/lib/rconftool.rb +387 -0
- data/lib/rwd/browser.rb +123 -0
- data/lib/rwd/ftools.rb +174 -0
- data/lib/rwd/mime.rb +328 -0
- data/lib/rwd/net.rb +876 -0
- data/lib/rwd/ruby.rb +889 -0
- data/lib/rwd/rwd.rb +1422 -0
- data/lib/rwd/sgml.rb +236 -0
- data/lib/rwd/thread.rb +63 -0
- data/lib/rwd/tree.rb +371 -0
- data/lib/rwd/xml.rb +101 -0
- data/lib/rwdthemes/default.rwd +317 -0
- data/lib/rwdthemes/pda.rwd +72 -0
- data/lib/rwdthemes/windowslike.rwd +171 -0
- data/lib/zip/ioextras.rb +114 -0
- data/lib/zip/stdrubyext.rb +111 -0
- data/lib/zip/tempfile_bugfixed.rb +195 -0
- data/lib/zip/zip.rb +1378 -0
- data/lib/zip/zipfilesystem.rb +558 -0
- data/lib/zip/ziprequire.rb +61 -0
- data/music/classicalmues.mp3 +0 -0
- data/rwd_files/HowTo_Mpd.txt +136 -0
- data/rwd_files/HowTo_Tinker.txt +482 -0
- data/rwd_files/HowTo_TinkerWin2.txt +202 -0
- data/rwd_files/Readme.txt +57 -0
- data/rwd_files/RubyWebDialogs.html +6 -0
- data/rwd_files/favicon.ico +0 -0
- data/rwd_files/rdoc-style.css +175 -0
- data/rwd_files/rwdapplications.html +54 -0
- data/rwd_files/tinker.png +0 -0
- data/rwdconfig.dist +22 -0
- data/rwdmpd.rb +1 -0
- data/tests/RubyGauge.rb +179 -0
- data/tests/checkdepends.sh +4 -0
- data/tests/cleancnf.sh +6 -0
- data/tests/makedist-rwdwmpd.rb +58 -0
- data/tests/makedist.rb +66 -0
- data/tests/rdep.rb +354 -0
- data/tests/totranslate.lang +93 -0
- data/zips/rwdwaddresses-1.06.zip +0 -0
- data/zips/rwdwcalc-0.62.zip +0 -0
- data/zips/rwdwfoldeditor-0.04.zip +0 -0
- data/zips/rwdwgutenberg-0.09.zip +0 -0
- data/zips/rwdwmpd-0.06.zip +0 -0
- data/zips/rwdwruby-1.07.zip +0 -0
- data/zips/temp.rb +1 -0
- data/zips/tinkerbellw-0.02.zip +0 -0
- data/zips/wrubyslippers-1.06.zip +0 -0
- metadata +220 -0
@@ -0,0 +1,11 @@
|
|
1
|
+
|
2
|
+
def rwdwmpd_0_06()
|
3
|
+
$tinkerdocumentsarray.delete_if {|x| x == "HowTo_Mpd.txt"}
|
4
|
+
$tinkerhelpaboutarray.delete_if {|x| x == "RwdMpd"}
|
5
|
+
Helptext.delete_if {|key, value| key == :rwdmpd_help}
|
6
|
+
Helptext.delete_if {|key, value| key == :rwdmpd_generalhelp }
|
7
|
+
|
8
|
+
$rwdjumplink.delete_if {|x| x == "RwdMpd"}
|
9
|
+
|
10
|
+
|
11
|
+
end
|
@@ -0,0 +1,139 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
|
3
|
+
# This is a very simple MPD client that just sends commands to the server
|
4
|
+
# from the command line
|
5
|
+
#
|
6
|
+
# Copyright 2006 Andrew Rader ( bitwise_mcgee AT yahoo.com | http://nymb.us )
|
7
|
+
#
|
8
|
+
|
9
|
+
def controlmpd(command,argopts = "")
|
10
|
+
|
11
|
+
require 'lib/librmpd'
|
12
|
+
require 'thread'
|
13
|
+
|
14
|
+
mpd = MPD.new
|
15
|
+
mpd.connect
|
16
|
+
case command
|
17
|
+
when 'seekid'
|
18
|
+
tmpstats = mpd.seekid( argopts.to_i , argopts.to_i)
|
19
|
+
tmpresulthash = mpd.current_song
|
20
|
+
tmpstats = ""
|
21
|
+
tmpresulthash.each_pair do |key, value|
|
22
|
+
|
23
|
+
tmpstats = tmpstats + "#{key} => #{value}\n"
|
24
|
+
end
|
25
|
+
mpd.disconnect
|
26
|
+
return tmpstats
|
27
|
+
when 'albums'
|
28
|
+
temparrayresult = mpd.albums
|
29
|
+
tmpresult = ""
|
30
|
+
temparrayresult.each {|x|
|
31
|
+
tmpresult = tmpresult + "\n#{x}"
|
32
|
+
}
|
33
|
+
mpd.disconnect
|
34
|
+
return tmpresult
|
35
|
+
|
36
|
+
when 'files'
|
37
|
+
temparrayresult = mpd.files
|
38
|
+
tmpresult = ""
|
39
|
+
temparrayresult.each {|x|
|
40
|
+
tmpresult = tmpresult + "\n#{x}"
|
41
|
+
}
|
42
|
+
mpd.disconnect
|
43
|
+
return tmpresult
|
44
|
+
when 'playlists'
|
45
|
+
tmpstats = mpd.playlists
|
46
|
+
totalresult = ""
|
47
|
+
tmpstats.each { |part|
|
48
|
+
totalresult = totalresult + "#{part}\n"
|
49
|
+
}
|
50
|
+
mpd.disconnect
|
51
|
+
return totalresult
|
52
|
+
when 'load'
|
53
|
+
mpd.load( argopts.to_s)
|
54
|
+
mpd.play
|
55
|
+
tmpresulthash = mpd.current_song
|
56
|
+
tmpstats = ""
|
57
|
+
tmpresulthash.each_pair do |key, value|
|
58
|
+
|
59
|
+
tmpstats = tmpstats + "#{key} => #{value}\n"
|
60
|
+
end
|
61
|
+
mpd.disconnect
|
62
|
+
return tmpstats
|
63
|
+
when 'search_artist'
|
64
|
+
tmpstats = mpd.search( 'artist', argopts.to_s)
|
65
|
+
mpd.disconnect
|
66
|
+
return tmpstats
|
67
|
+
when 'play'
|
68
|
+
mpd.play argopts
|
69
|
+
tmpresulthash = mpd.current_song
|
70
|
+
tmpstats = ""
|
71
|
+
tmpresulthash.each_pair do |key, value|
|
72
|
+
|
73
|
+
tmpstats = tmpstats + "#{key} => #{value}\n"
|
74
|
+
end
|
75
|
+
mpd.disconnect
|
76
|
+
return tmpstats
|
77
|
+
when 'pause'
|
78
|
+
mpd.pause = !mpd.paused?
|
79
|
+
tmpresulthash = mpd.current_song
|
80
|
+
tmpstats = ""
|
81
|
+
tmpresulthash.each_pair do |key, value|
|
82
|
+
|
83
|
+
tmpstats = tmpstats + "#{key} => #{value}\n"
|
84
|
+
end
|
85
|
+
mpd.disconnect
|
86
|
+
return tmpstats
|
87
|
+
when 'stop'
|
88
|
+
mpd.stop
|
89
|
+
when 'next'
|
90
|
+
mpd.next
|
91
|
+
tmpresulthash = mpd.current_song
|
92
|
+
tmpstats = ""
|
93
|
+
tmpresulthash.each_pair do |key, value|
|
94
|
+
|
95
|
+
tmpstats = tmpstats + "#{key} => #{value}\n"
|
96
|
+
end
|
97
|
+
mpd.disconnect
|
98
|
+
return tmpstats
|
99
|
+
when 'prev'
|
100
|
+
mpd.previous
|
101
|
+
tmpresulthash = mpd.current_song
|
102
|
+
tmpstats = ""
|
103
|
+
tmpresulthash.each_pair do |key, value|
|
104
|
+
|
105
|
+
tmpstats = tmpstats + "#{key} => #{value}\n"
|
106
|
+
end
|
107
|
+
mpd.disconnect
|
108
|
+
return tmpstats
|
109
|
+
when 'volume'
|
110
|
+
mpd.volume = argopts.to_i
|
111
|
+
|
112
|
+
when 'repeat'
|
113
|
+
mpd.repeat = !mpd.repeat?
|
114
|
+
when 'random'
|
115
|
+
mpd.random = !mpd.random?
|
116
|
+
when 'stats'
|
117
|
+
hash = mpd.stats
|
118
|
+
tmpstats = ""
|
119
|
+
hash.each_pair do |key, value|
|
120
|
+
|
121
|
+
tmpstats = tmpstats + "#{key} => #{value}\n"
|
122
|
+
end
|
123
|
+
mpd.disconnect
|
124
|
+
return tmpstats
|
125
|
+
when 'status'
|
126
|
+
hash = mpd.status
|
127
|
+
tmpstats = ""
|
128
|
+
hash.each_pair do |key, value|
|
129
|
+
|
130
|
+
tmpstats = tmpstats + "#{key} => #{value}\n"
|
131
|
+
end
|
132
|
+
mpd.disconnect
|
133
|
+
return tmpstats
|
134
|
+
else
|
135
|
+
$stderr.puts "Unknown Command #{command}"
|
136
|
+
end
|
137
|
+
mpd.disconnect
|
138
|
+
|
139
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
Helptext.update( :rwdmpd_help => " This program uses the files from the libmpd project
|
4
|
+
You can play mp3 ogg flac files with this program
|
5
|
+
<p>
|
6
|
+
You need mpd installed",
|
7
|
+
:rwdmpd_generalhelp => "
|
8
|
+
|
9
|
+
You will need mpd installed
|
10
|
+
<p>
|
11
|
+
Commands Available:<p>
|
12
|
+
next<p>
|
13
|
+
pause<p>
|
14
|
+
play<p>
|
15
|
+
prev<p>
|
16
|
+
stop<p>
|
17
|
+
stats ",
|
18
|
+
|
19
|
+
:mpdcommand_help => "
|
20
|
+
Commands Available: (use | to divide arguments)<p>
|
21
|
+
albums<p>
|
22
|
+
artists<p>
|
23
|
+
connected?<p>
|
24
|
+
current_song<p>
|
25
|
+
list| (album,artist,title,file)<p>
|
26
|
+
directories<p>
|
27
|
+
files<p>
|
28
|
+
playlists<p>
|
29
|
+
songs<p>
|
30
|
+
songs_by_artist<p>
|
31
|
+
playlist_version<p>
|
32
|
+
playlist<p>
|
33
|
+
song_at_pos|(integer)
|
34
|
+
",
|
35
|
+
:mpdplaylist_help => "
|
36
|
+
The $rwdmpdplaylist_directory needs to be set<p>
|
37
|
+
on Debian Linux the default is '/var/lib/mpd/playlists/'<p>
|
38
|
+
You can load and edit playlists<p>
|
39
|
+
The song locations start from the MPD music directory<p>
|
40
|
+
"
|
41
|
+
)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# this code is to list the playlists that are installed
|
2
|
+
def loadmpdplaylistfilelist
|
3
|
+
|
4
|
+
fileList = Dir.new($rwdmpdplaylist_directory ).entries.sort.delete_if { |x| ! (x =~ /m3u/) }
|
5
|
+
@playlistresults = fileList.rwd_method("superantcomshowplaylistdirsname")
|
6
|
+
end
|
7
|
+
|
8
|
+
def superantcomshowplaylistdirsname(inffile)
|
9
|
+
applet = inffile
|
10
|
+
@a_playlistfinename = applet
|
11
|
+
|
12
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# this method puts the configuration rexord on the screen
|
2
|
+
def loadrwdmp3configuration
|
3
|
+
|
4
|
+
require 'fileutils'
|
5
|
+
|
6
|
+
@a_mp3configurationfilename = "rwdwmpd-" + RwdMpdVersion + ".cnf"
|
7
|
+
|
8
|
+
|
9
|
+
begin # exception trapped block
|
10
|
+
|
11
|
+
Dir.chdir($progdir)
|
12
|
+
fileName = File.join(ConfigurationDir, @a_mp3configurationfilename)
|
13
|
+
|
14
|
+
fd = File.open(fileName,"r")
|
15
|
+
@a_mp3configline1= fd.read
|
16
|
+
|
17
|
+
fd.close
|
18
|
+
rescue SystemCallError, StandardError
|
19
|
+
$stderr.print "system call error: " + $!
|
20
|
+
end # exception rescue
|
21
|
+
|
22
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# this method loads the on screen variables into the running class
|
2
|
+
def loadmpdconfigurationvariables
|
3
|
+
|
4
|
+
tmpfilename = "rwdwmpd-" + RwdMpdVersion + ".cnf"
|
5
|
+
configfiletoload = File.join(ConfigurationDir, tmpfilename )
|
6
|
+
begin
|
7
|
+
load configfiletoload
|
8
|
+
rescue
|
9
|
+
if $DEBUG
|
10
|
+
$stderr.puts "config loading error"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# this method puts the playlist record on the screen
|
2
|
+
def loadrwdmpdplaylistrecord
|
3
|
+
require 'fileutils'
|
4
|
+
|
5
|
+
|
6
|
+
begin # exception trapped block
|
7
|
+
|
8
|
+
Dir.chdir($progdir)
|
9
|
+
fileName = File.join($rwdmpdplaylist_directory, @a_playlistfinename.to_s.strip)
|
10
|
+
|
11
|
+
fd = File.open(fileName,"r")
|
12
|
+
@rwdmpdplaylistcontents = fd.read
|
13
|
+
|
14
|
+
fd.close
|
15
|
+
rescue SystemCallError, StandardError
|
16
|
+
$stderr.print "system call error: " + $!
|
17
|
+
end # exception rescue
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
#
|
2
|
+
|
3
|
+
def runmpdcommand
|
4
|
+
|
5
|
+
require 'lib/librmpd'
|
6
|
+
require 'thread'
|
7
|
+
|
8
|
+
mpd = MPD.new
|
9
|
+
mpd.connect
|
10
|
+
|
11
|
+
temparray = @a_mpdcommand.to_s.split('|')
|
12
|
+
case temparray.length
|
13
|
+
when 1
|
14
|
+
commandtext = @a_mpdcommand.to_s
|
15
|
+
temparrayresult = mpd.send(commandtext.intern)
|
16
|
+
when 2
|
17
|
+
commandtext =temparray[0]
|
18
|
+
temparrayresult = mpd.send(commandtext.intern,temparray[1] )
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
mpd.disconnect
|
23
|
+
tmpresult = ""
|
24
|
+
@mpdcommandresult = temparrayresult
|
25
|
+
begin
|
26
|
+
temparrayresult.each {|x|
|
27
|
+
tmpresult = tmpresult + "\n#{x}"
|
28
|
+
}
|
29
|
+
@mpdcommandresult = tmpresult
|
30
|
+
rescue
|
31
|
+
@mpdcommandresult = temparrayresult
|
32
|
+
if $DEBUG
|
33
|
+
$stderr.puts "error mpd_client.rb"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#
|
2
|
+
def runmpdseekcommand
|
3
|
+
commandtext = @a_mpdseekcommandinput.to_s
|
4
|
+
|
5
|
+
@mpdseekcommandresult = controlmpd(commandtext , @a_mpdseekname)
|
6
|
+
|
7
|
+
@lastmpdseekcommand = commandtext
|
8
|
+
# Close the socket after use
|
9
|
+
|
10
|
+
end
|
11
|
+
|
12
|
+
|
13
|
+
def showmpdseekcommandoptions
|
14
|
+
@mpdseekcommandoptions = ["playlists",'load','search_artist','seekid','albums','files',"next","pause","play","prev","stop","stats","status" ].rwd_options
|
15
|
+
end
|
16
|
+
|
17
|
+
def mpdprevbutton
|
18
|
+
@mpdseekcommandresult = controlmpd('prev', "")
|
19
|
+
end
|
20
|
+
|
21
|
+
def mpdnextbutton
|
22
|
+
@mpdseekcommandresult = controlmpd('next', "")
|
23
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# this code is to call the help window
|
2
|
+
def runhelpwindowrwdmp3
|
3
|
+
|
4
|
+
$help_topic = "rwdmpd_generalhelp"
|
5
|
+
if @rwd_tab == "rwdmpd2"
|
6
|
+
$help_topic = "rwdmpd_help"
|
7
|
+
end
|
8
|
+
if @rwd_tab == "rwdmpd3"
|
9
|
+
$help_topic = "mpdcommand_help"
|
10
|
+
end
|
11
|
+
if @rwd_tab == "superantcomeditplaylistfile"
|
12
|
+
$help_topic = "mpdplaylist_help"
|
13
|
+
end
|
14
|
+
$helptopicsarray = $helptopicsarray | ["rwdmpd_generalhelp","rwdmpd_help","mpdplaylist_help"]
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
if @rwd_window != "rwdtinkerhelpwindow"
|
19
|
+
$previouswindow = @rwd_window
|
20
|
+
$previoustab = @rwd_tab
|
21
|
+
end
|
22
|
+
runhelpwindow
|
23
|
+
end
|
24
|
+
|
25
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Application RwdAddresses orginally (c) 2004 Steven Gibson under GPL.
|
2
|
+
# This application is a contact book
|
3
|
+
# For more information about see http://www.rubyforge.net/projects/rwdapplications
|
4
|
+
|
5
|
+
# call the window
|
6
|
+
def runrwdmpdwindow
|
7
|
+
@rwd_window = "rwdmpdwindow"
|
8
|
+
@rwd_tab = "rwdmpd2"
|
9
|
+
end
|
10
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Application RwdTinker orginally (c) 2004 Steven Gibson under GPL.
|
2
|
+
# This application is a framework for writing programs from RubyWebDialogs
|
3
|
+
# For information see http://www.rubyforge.net/projects/rwdapplications
|
4
|
+
|
5
|
+
# return the version constant defined in the config file
|
6
|
+
def rwdmpdhelpaboutsetup
|
7
|
+
return ["RwdMpd","(c) 2005-2008 Steven Gibson ","Version #{RwdMpdVersion}"]
|
8
|
+
end
|
9
|
+
|
10
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# this method adds a new address record
|
2
|
+
def saverwdmp3configuration
|
3
|
+
require 'fileutils'
|
4
|
+
@a_mp3configurationfilename = "rwdwmpd-" + RwdMpdVersion + ".cnf"
|
5
|
+
|
6
|
+
if @a_mp3configurationfilename
|
7
|
+
newname = "%s" % [@a_mp3configurationfilename] # grab the filename to create
|
8
|
+
newdata =@a_mp3configline1.to_s
|
9
|
+
begin # exception trapped block
|
10
|
+
fileName = File.join( ConfigurationDir, newname )
|
11
|
+
fd = File.open(fileName,"w")
|
12
|
+
fd.print(newdata) # save the record info to the file
|
13
|
+
fd.close
|
14
|
+
@newmp3configurationresult=newdata # show the record info in the browser
|
15
|
+
rescue SystemCallError, StandardError
|
16
|
+
$stderr.print "system call error: " + $!
|
17
|
+
end # exception rescue
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# this method saves a record
|
2
|
+
def saverwdmp3playlist
|
3
|
+
require 'fileutils'
|
4
|
+
|
5
|
+
|
6
|
+
newname = @a_playlistfinename.to_s.strip # grab the filename to create
|
7
|
+
newdata = @rwdmpdplaylistcontents.to_s
|
8
|
+
begin # exception trapped block
|
9
|
+
fileName = File.join( $rwdmpdplaylist_directory , newname )
|
10
|
+
fd = File.open(fileName,"w")
|
11
|
+
fd.print(newdata) # save the record info to the file
|
12
|
+
fd.close
|
13
|
+
|
14
|
+
rescue SystemCallError, StandardError
|
15
|
+
$stderr.print "system call error: " + $!
|
16
|
+
end # exception rescue
|
17
|
+
|
18
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
def startmp3server
|
4
|
+
|
5
|
+
begin # begin rescue monitored block
|
6
|
+
|
7
|
+
command_file_path = File.join( $extras_directory, 'mp3controld' )
|
8
|
+
|
9
|
+
@showrwdmp3result = IO::popen("ruby #{command_file_path}",'r+')
|
10
|
+
|
11
|
+
rescue # process exeption
|
12
|
+
@showrwdmp3result = "\n" + "error in eval"
|
13
|
+
end # end of rescue process # of rescure monitored block
|
14
|
+
|
15
|
+
end
|
16
|
+
|