-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
125 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
if(PHP_SAPI !== 'cli') { die('This script can\'t be run from a web browser. Use CLI to run it.'); } | ||
|
||
$plugin_description = 'Controls winamp: !winamp <help>'; | ||
$plugin_command = 'winamp'; | ||
|
||
/* | ||
NEED TO CONFIGURE! | ||
Specify winamp CLAmp.exe program location | ||
*/ | ||
$GLOBALS['winamp_loc'] = 'C:\Dokumenty\programy\Winamp\CLAmp.exe'; | ||
//--- | ||
|
||
|
||
function plugin_winamp() | ||
{ | ||
|
||
if(empty($GLOBALS['args'])) { CHANNEL_MSG('Usage: '.$GLOBALS['C_CMD_PREFIX'].'winamp <help> to list commands'); } | ||
|
||
else { | ||
|
||
switch($GLOBALS['args']) { | ||
|
||
case "help": | ||
CHANNEL_MSG('Winamp commands:'); | ||
CHANNEL_MSG('winamp stop - Stop music: !winamp stop'); | ||
CHANNEL_MSG('winamp pause - Pause music: !winamp pause'); | ||
CHANNEL_MSG('winamp play - Play music: !winamp play'); | ||
CHANNEL_MSG('winamp next - Next song: !winamp next'); | ||
CHANNEL_MSG('winamp prev - Previous song: !winamp prev'); | ||
CHANNEL_MSG('winamp title - Show song title: !winamp title'); | ||
break; | ||
|
||
case "stop": exec($GLOBALS['winamp_loc'].' /stop'); break; | ||
case "pause": exec($GLOBALS['winamp_loc'].' /pause'); break; | ||
case "play": exec($GLOBALS['winamp_loc'].' /play'); sendTitle($target); break; | ||
case "next": exec($GLOBALS['winamp_loc'].' /next'); sendTitle($target); break; | ||
case "prev": exec($GLOBALS['winamp_loc'].' /prev'); sendTitle($target); break; | ||
case "title": sendTitle($target); break; | ||
} | ||
} | ||
} | ||
|
||
function sendTitle($target) | ||
{ | ||
$title = exec($GLOBALS['winamp_loc'].' /title'); | ||
CHANNEL_MSG("Playing: ".$title, $target); | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters