Jump to content




RAC Media Player [v2.0]


4 replies to this topic

#1 neonerz

  • Members
  • 4 posts

Posted 03 March 2014 - 06:05 PM

RMPv2 is a ComputerCraft based media player that support both Music Disc's and Open Block's new Radio feature.

Features
  • Touchscreen
  • Auto-Scanning of discs (Adding new discs is as easy as dropping one in a chest and hitting scan)
  • Radio Support!
  • Volume support for the radio
  • Support for future mods that add music discs (this script will support any mod that adds Music Discs. Just make sure you follow step one)
Prerequisites
  • ComputerCraft (duh)
  • Open Peripherals (getAllStacks() is required to read the chest and radio)
  • Open Blocks (optional for radio support)
Video Instructions:



Images:
Posted ImagePosted Image

Install
  • Rename your music discs in an anvil using the following format "Author - Title" (if you do not do this, the turtle-dj will not be able to recognize the track names. Radio crystals are already named properly, so they don't need to be renamed)
  • Setup a wireless turtle with a chest below it (containing your music discs and optional radio crystals) and a disk drive above it. (position of chest and disk drive can be swapped, but will need to be edited in the code. They must be either above or below the turtle. Putting the chest and disk drive in any other position is not supported)
    • If you want radio support, the radio needs to go *in front* of the turtle. Any other position is not supported
  • Download the turtle-dj script from pastebin. There is some variables to configure, but we can do that after setting up the monitor
    • pastebin get Sc9G4Px2 turtle-dj
  • Setup an advanced computer with a wireless rednet modem and an advanced monitor in at least a 4x3 configuration (larger displays are supported, but this is the minimum.)
  • Download the main rmpv2 script from pastebin
    • pastebin get vN9eJaqT rmpv2
  • Configure the following parameters inside the script (#edit rmpv2)
    • modem - The side of the computer the modem is attached to
    • monitor - The side of the computer the monitor is attached to
    • turtle - The ID of the turtle-dj (this could be found out by executing the 'id' command on the turtle)
    • radioCrystal - This is the item ID of a Radio Crystal. If you aren't using the optional radio support, this can be left alone
  • Now get the ID of the computer that's running the monitor and edit the following parameters on the turtle-dj script (edit turtle-dj)
    • chest - The position of the chest
    • drive - The position of the drive
    • modem - The position of the turtle's modem (keep in mind, this will almost always be 'right')
    • radio - The position of the radio if you want optional radio support (this should always be left as 'front' as the script only support radios in front of the turtle)
    • radioCrystal - This is the item ID of a Radio Crystal. If you aren't using the optional radio support, this can be left alone
    • monitor - the ID of the computer running the monitor
  • Optional Set the startup script to run the downloaded application if you want the script to run as soon as the computer boots up
    • edit startup (on both the computer and turtle)
    • computer: shell.run("rmpv2")
    • turtle: shell.run("turtle-dj")
  • Start both the turtle-dj script and the rmpv2 script
  • Listen to some cool jams!
Pastebin Links:

rmpv2 (computer's code): http://pastebin.com/vN9eJaqT
turtle-dj (turtle's code): http://pastebin.com/Sc9G4Px2

Known Bugs:
  • 4x3 screen size needs to be updated. For some reason if you place a 4x3 screen first, the spacing will be offset. To fix this, make the monitor larger (5x3 for instance), hit scan to refresh the screen size, then remove the extra row of monitors (4x3 again) and hit scan again
  • If an item (besides a radio crystal) is included in the chest, but isn't named in the "Author - Title" format, the scan will stop when hitting that item
Future Additions:
  • Multi-page Support. I was not able to get this added to this version. That means if you run out of space on the screen, you'll need to make the monitor bigger to support more songs. (the minimum screen size of 4x3 supports up to 24 tracks)
Things I'd like to add, but can't:
  • Volume Support for Music Discs. Unfortunately there's currently no way to raise or lower the volume of a music disc since it's completely client side. As far as I'm aware, CC would have to write a completely new music API to implement this feature. (it does work for radio stations though)
  • Random/Repeat/Playlist functions. Since a Disk Drive can't detect when it's done playing music (for similar reasons as above), there's no logical way to create those features. I am open to suggestions though.
Final Notes:

I never claim to be a developer, as such my code might not be the cleanest or bug free.

As with all my scripts, you are completely free to do whatever you want with this. Edit it, incorporate it into your own project, distribute it, etc. The only thing I ask is if you edit it or incorporate it into your own project you give me a shout out. This is only a friendly suggestion, you are welcome to be a jerk and claim it as your own.

If you do incorporate this into your own project, shoot me a message, I'd love to check it out.

Edited by neonerz, 03 March 2014 - 06:06 PM.


#2 kwstoudt

  • Members
  • 18 posts
  • LocationProvo, Utah

Posted 30 July 2014 - 11:43 PM

Is there any way you could change this or tweak it so that it doesn't require a turtle? they are banned on the server I want to use this on

#3 H4X0RZ

  • Members
  • 1,315 posts
  • LocationGermany

Posted 31 July 2014 - 12:13 AM

View Postkwstoudt, on 30 July 2014 - 11:43 PM, said:

Is there any way you could change this or tweak it so that it doesn't require a turtle? they are banned on the server I want to use this on
Unfortunately, he isn't able to make it "turtle-less" since a computer can't handle items by default. BUT I saw someone made a "Computer Item Buffer" a while ago which allowed a computer to push one item at a time.

#4 Not-A-Spammer

  • Members
  • 5 posts

Posted 02 August 2014 - 08:32 PM

This Is Awesome!! Is There Any Way You Can Make A Pocket Computer Version?

#5 bigbrainiac10

  • Members
  • 41 posts

Posted 04 August 2014 - 11:28 AM

View PostFreack100, on 31 July 2014 - 12:13 AM, said:

View Postkwstoudt, on 30 July 2014 - 11:43 PM, said:

Is there any way you could change this or tweak it so that it doesn't require a turtle? they are banned on the server I want to use this on
Unfortunately, he isn't able to make it "turtle-less" since a computer can't handle items by default. BUT I saw someone made a "Computer Item Buffer" a while ago which allowed a computer to push one item at a time.

Actually, this is possible using OpenPeripherals, which I'm assuming will be installed if ComputerCraft and OpenBlocks are installed.

To do this with OpenPeripherals, I believe it's just a method like "pullItem" or "pushItem", it's quite easy to use.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users