restructuring project

This commit is contained in:
Ralph Caraveo committed 2014-05-02 18:38:29 -07:00
1 parent 3cb777e5dd
commit be3654723f
12 files changed
+40 -50

No files matched your search

-1
View File
@@ -1 +0,0 @@
HTML5-CDGPlayer_files/output
+35 -3
View File
@@ -1,6 +1,38 @@
html5-cdgplayer
karaoke4go
===============
An html5 based cdg-player for mp3+cdg karaoke files
karaoke4go is an extremely *early* alpha prototype of the CDG file format that was developed by Phillips and Sony entertainment to display timed lyrics along with music for the purpose of getting drunk with your friends and singing horribly into a mic.
screenshots
===========
why?
====
Why not? Go is a fantastic language and this was an excuse to have some fun with it while exploring the image packages. Unfortunately, Go doesn't have a native package for rendering GUIs so this package currently only renders a series of .png images. Eventually, the idea is to utilize some community driven package such as GoQML to render the graphics in realtime so this thing actually works.
a partial port
==============
So, I've actually built this from scratch twice before once using raw C and the popular SDL library. And the second time, I built this in Flash way back when the raw bitmap api was introduced. This time around, I did get a little lazy and actually ported this version from the excellent: CDGMagic HTML5 canvas based version locatated at: http://cdgmagic.sourceforge.net/html5_cdgplayer/ This version actually works beautifully and runs smooth. Again, consider this version a fun excercize in Go...at least for now.
caveats
========
* It's not a typical Go package yet, so you can't import it
* There are currently no tests
* The code in its current state is partially broken, but it does render mostly correct at this point
* The code eventually should be cleaned up and simplified with more idiomatic Go code
* It does not play in realtime, it only generates an image sequence currently
* There is no music implementation yet
* It has not been optimized yet
contributions
=============
* are encouraged
From this url: http://cdgmagic.sourceforge.net/html5_cdgplayer/
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -9,45 +9,6 @@ import (
"os"
)
/*
* This file is part of CD+Graphics Magic.
*
* CD+Graphics Magic is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* CD+Graphics Magic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CD+Graphics Magic. If not, see <http://www.gnu.org/licenses/>.
*
*/
/*
* This class instantiates an HTML5/Canvas CD+Graphics decoder object.
*
* This is the "low resource" version, and should be very close
* to as fast as possible with JavaScript.
*
* The difference between the "low resource" and normal version
* is that this one packs each 6 pixel font line in to one
* array value, unrolling some loops and minimizing array lookups.
*
* The only concession made is lack of H/V "offset" support used
* for smooth scrolling.
* Block based scrolls *are* still supported, however, so the basic
* intent of the graphics is presented, but less than ideally.
*
* It is recommended for CPU constrained (eg. mobile or embedded) devices.
*
*/
// Useful enums for CD+Graphics...
const (
VRAM_SIZE = 300 * 216 // Total linear size of VRAM, in pixels.
VRAM_WIDTH = 300 // Width (or pitch) of VRAM, in pixels.
@@ -97,10 +58,8 @@ func init() {
func main() {
fmt.Println("Compiles baby!")
//load data
cdg_file_data, err := ioutil.ReadFile("../SC-SBI-REMIX - Billy Idol - Rebel Yell.cdg")
cdg_file_data, err := ioutil.ReadFile("cdg/SC-SBI-REMIX - Billy Idol - Rebel Yell.cdg")
if err != nil {
log.Fatal("Couldn't read .cdg file")
}
@@ -112,9 +71,9 @@ func main() {
for i := 0; i < 20000; i++ {
decode_packs(cdg_file_data, i)
redrawCanvas()
//if i%100 == 0 {
snap(i)
//}
if i%100 == 0 {
snap(i)
}
}
//This command works, outputting the images as a video
@@ -123,7 +82,7 @@ func main() {
}
func snap(count int) {
out_filename := fmt.Sprintf("output/blank-%d.png", imageCount)
out_filename := fmt.Sprintf("screenshots/blank-%d.png", imageCount)
out_file, err := os.Create(out_filename)
if err != nil {
log.Fatal(err)
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB