-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathwhack.pl
136 lines (133 loc) · 7.05 KB
/
whack.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#!/usr/bin/perl -w
my %convertlist = (
"SliMP3::Buttons" => "Slim::Buttons",
"SliMP3::Animation" => "Slim::Display::Animation",
"SliMP3::CLI" => "Slim::Control::CLI",
"SliMP3::Command" => "Slim::Control::Command",
"SliMP3::Stdio" => "Slim::Control::Stdio",
"SliMP3::Animation" => "Slim::Display::Animation",
"SliMP3::Display::update.(.*?).;" => "->update();",
"SliMP3::Display" => "Slim::Display::Display",
"SliMP3::AIFF" => "Slim::Formats::AIFF",
"SliMP3::Movie" => "Slim::Formats::Movie",
"SliMP3::Ogg" => "Slim::Formats::Ogg",
"SliMP3::Parse" => "Slim::Formats::Parse",
"SliMP3::Wav" => "Slim::Formats::Wav",
"SliMP3::Decoder" => "Slim::Hardware::Decoder",
"SliMP3::IR" => "Slim::Hardware::IR",
"SliMP3::VFD" => "Slim::Hardware::VFD",
"SliMP3::i2c" => "Slim::Hardware::i2c",
"SliMP3::mas3507d" => "Slim::Hardware::mas3507d",
"SliMP3::mas35x9" => "Slim::Hardware::mas35x9",
"SliMP3::Info" => "Slim::Music::Info",
"SliMP3::MoodLogic" => "Slim::Music::MoodLogic",
"SliMP3::MusicFolderScan" => "Slim::Music::MusicFolderScan",
"SliMP3::iTunes" => "Slim::Music::iTunes",
"SliMP3::mDNS" => "Slim::Networking::mDNS",
"SliMP3::Client" => "Slim::Player::Client",
"SliMP3::Control::volume.(.*?),(.*?).;" => "->volume(",
"SliMP3::Control::treble.(.*?),(.*?).;" => "->treble(",
"SliMP3::Control::bass.(.*?),(.*?).;" => "->bass(",
"SliMP3::Control::fade_volume.(.*?),(.*?).;" => "->fade_volume(",
"SliMP3::Control::mute.(.*?).;" => "->mute();",
"SliMP3::Control::mute" => "$client->mute",
"SliMP3::Control::play.(.*?),(.*?).;" => "->play(",
"SliMP3::Control::stop.(.*?).;" => "->stop();",
"SliMP3::Control::resume.(.*?).;" => "->resume();",
"SliMP3::Control::pause.(.*?).;" => "->pause();",
"SliMP3::Control::playout.(.*?).;" => "->playout();",
"SliMP3::Control::maxVolume" => "Slim::Player::Client::maxVolume",
"SliMP3::Control::maxTreble" => "Slim::Player::Client::maxTreble",
"SliMP3::Control::minTreble" => "Slim::Player::Client::minTreble",
"SliMP3::Control::maxBass" => "Slim::Player::Client::maxBass",
"SliMP3::Control::minBass" => "Slim::Player::Client::minBass",
"SliMP3::Discovery" => "Slim::Networking::Discovery",
"use SliMP3::Playlist" => "use Slim::Player::Playlist;\nuse Slim::Player::Source;\nuse Slim::Player::Sync",
"SliMP3::Playlist::syncname" => "Slim::Player::Sync::syncname",
"SliMP3::Playlist::syncwith" => "Slim::Player::Sync::syncwith",
"SliMP3::Playlist::unsync" => "Slim::Player::Sync::unsync",
"SliMP3::Playlist::sync" => "Slim::Player::Sync::sync",
"SliMP3::Playlist::saveSyncPrefs" => "Slim::Player::Sync::saveSyncPrefs",
"SliMP3::Playlist::restoreSync" => "Slim::Player::Sync::restoreSync",
"SliMP3::Playlist::syncedWith" => "Slim::Player::Sync::syncedWith",
"SliMP3::Playlist::isSyncedWith" => "Slim::Player::Sync::isSyncedWith",
"SliMP3::Playlist::canSyncWith" => "Slim::Player::Sync::canSyncWith",
"SliMP3::Playlist::checkSync" => "Slim::Player::Sync::checkSync",
"SliMP3::Playlist::isMaster" => "Slim::Player::Sync::isMaster",
"SliMP3::Playlist::master" => "Slim::Player::Sync::master",
"SliMP3::Playlist::slaves" => "Slim::Player::Sync::slaves",
"SliMP3::Playlist::isSlave" => "Slim::Player::Sync::isSlave",
"SliMP3::Playlist::masterOrSelf" => "Slim::Player::Sync::masterOrSelf",
"SliMP3::Playlist::isSynced" => "Slim::Player::Sync::isSynced",
"SliMP3::Playlist::rate" => "Slim::Player::Source::rate",
"SliMP3::Playlist::songTime" => "Slim::Player::Source::songTime",
"SliMP3::Playlist::songRealPos" => "Slim::Player::Source::songRealPos",
"SliMP3::Playlist::playmode" => "Slim::Player::Source::playmode",
"SliMP3::Playlist::lastChunk" => "Slim::Player::Source::lastChunk",
"SliMP3::Playlist::nextChunk" => "Slim::Player::Source::nextChunk",
"SliMP3::Playlist::gototime" => "Slim::Player::Source::gototime",
"SliMP3::Playlist::jumpto" => "Slim::Player::Source::jumpto",
"SliMP3::Playlist::openNext" => "Slim::Player::Source::openNext",
"SliMP3::Playlist::currentSongIndex" => "Slim::Player::Source::currentSongIndex",
"SliMP3::Playlist::closeSong" => "Slim::Player::Source::closeSong",
"SliMP3::Playlist::openSong" => "Slim::Player::Source::openSong",
"SliMP3::Playlist::readNextChunk" => "Slim::Player::Source::readNextChunk",
"SliMP3::Playlist::pauseSynced" => "Slim::Player::Source::pauseSynced",
"SliMP3::Playlist::count" => "Slim::Player::Playlist::count",
"SliMP3::Playlist::song" => "Slim::Player::Playlist::song",
"SliMP3::Playlist::shuffleList" => "Slim::Player::Playlist::shuffleList",
"SliMP3::Playlist::playList" => "Slim::Player::Playlist::playList",
"SliMP3::Playlist::shuffle" => "Slim::Player::Playlist::shuffle",
"SliMP3::Playlist::repeat" => "Slim::Player::Playlist::repeat",
"SliMP3::Playlist::copyPlaylist" => "Slim::Player::Playlist::copyPlaylist",
"SliMP3::Playlist::removeTrack" => "Slim::Player::Playlist::removeTrack",
"SliMP3::Playlist::removeMultipleTracks" => "Slim::Player::Playlist::removeMultipleTracks",
"SliMP3::Playlist::forgetClient" => "Slim::Player::Playlist::forgetClient",
"SliMP3::Playlist::refreshPlaylist" => "Slim::Player::Playlist::refreshPlaylist",
"SliMP3::Playlist::moveSong" => "Slim::Player::Playlist::moveSong",
"SliMP3::Playlist::clear" => "Slim::Player::Playlist::clear",
"SliMP3::Playlist::fischer_yates_shuffle" => "Slim::Player::Playlist::fischer_yates_shuffle",
"SliMP3::Playlist::reshuffle" => "Slim::Player::Playlist::reshuffle",
"SliMP3::Playlist::executecommand" => "Slim::Player::Playlist::executecommand",
"SliMP3::Playlist::setExecuteCommandCallback" => "Slim::Player::Playlist::setExecuteCommandCallback",
"SliMP3::Playlist::clearExecuteCommandCallback" => "Slim::Player::Playlist::clearExecuteCommandCallback",
"SliMP3::Playlist::modifyPlaylistCallback" => "Slim::Player::Playlist::modifyPlaylistCallback",
"SliMP3::Protocol" => "Slim::Networking::Protocol",
"SliMP3::Stream" => "Slim::Networking::Stream",
"SliMP3::Misc" => "Slim::Utils::Misc",
"SliMP3::OSDetect" => "Slim::Utils::OSDetect",
"SliMP3::Prefs" => "Slim::Utils::Prefs",
"SliMP3::Scan" => "Slim::Utils::Scan",
"SliMP3::Scheduler" => "Slim::Utils::Scheduler",
"SliMP3::Strings" => "Slim::Utils::Strings",
"SliMP3::Timers" => "Slim::Utils::Timers",
"SliMP3::HTTP" => "Slim::Web::HTTP",
"SliMP3::History" => "Slim::Web::History",
"SliMP3::Olson" => "Slim::Web::Olson",
"SliMP3::Pages" => "Slim::Web::Pages",
"SliMP3::RemoteStream" => "Slim::Web::RemoteStream",
"SliMP3::Setup" => "Slim::Web::Setup"
);
foreach my $file (@ARGV) {
rename ($file, $file . ".old");
open(FILE, $file . ".old") or die "can't open $file";
#open(FILE, $file) or die "can't open $file";
open(OUTFILE, ">$file");
while ($line = <FILE>) {
foreach my $tag (keys %convertlist) {
if ($line =~ m/$tag/i) {
if (defined($1)) {
if (defined($2)) {
$line =~ s/$tag/$1.$convertlist{$tag}.$2.");"/ge;
} else {
$line =~ s/$tag/$1.$convertlist{$tag}/ge;
}
} else {$line =~ s/$tag/$convertlist{$tag}/ge;}
# $tag,$convertlist{$tag} => $line\n";
}
}
print OUTFILE $line;
}
close FILE;
close OUTFILE;
}