Author Topic: Hey guys, I'm starting Small Basic. :D [Music Player V2.5]  (Read 5777 times)

I'm working on a MP3/WMA/WAV/AAC/M4A/OGG player.

OGG part is using a codec pack I installed on my computer to play OGG, asdf. Same for M4A and AAC.

All functions (play, pause, stop) are working.
Miracles by the ICP is my test file. lol.

Here's the code if anyone's interested.
Code: [Select]
TextWindow.Show()
TextWindow.WriteLine("Initalizing...")
GraphicsWindow.Show()
TextWindow.WriteLine("Setting font and color properties...")
GraphicsWindow.FontName = "Tahoma"
GraphicsWindow.BackgroundColor = "#000000"
GraphicsWindow.PenColor = "#FFFFFF"
GraphicsWindow.BrushColor = "#FFFFFF"
TextWindow.WriteLine("Getting random Flickr picture...")
bg = Flickr.GetRandomPicture("Trees")
TextWindow.WriteLine("Setting it as the background in the audio player...")
GraphicsWindow.DrawImage(bg, 0, 0)
TextWindow.WriteLine("Drawing textbox...")
GraphicsWindow.DrawText(25, 25, "Please enter the filename of the audio you wish to play.")
GraphicsWindow.PenColor = "#000000"
GraphicsWindow.BrushColor = "#000000"
fn2enter = Controls.AddTextBox(25, 45)
TextWindow.WriteLine("Drawing buttons...")
GraphicsWindow.FontName = "Webdings"
bttnplay = Controls.AddButton("4", 25, 75)
bttnpause = Controls.AddButton(";", 50, 75)
bttnstop = Controls.AddButton("g", 75, 75)
TextWindow.WriteLine("Setting the width and height...")
GraphicsWindow.Width = 400
GraphicsWindow.Height = 135
TextWindow.WriteLine("Ready.")

begin:
Program.Delay(100)
GraphicsWindow.Title = filename
If Controls.LastClickedButton = bttnplay Then
  filename = Controls.GetTextBoxText(fn2enter)
  If filename = filenameubo Then
  Else
  TextWindow.Write("[")
  TextWindow.Write(Clock.Time)
  TextWindow.Write("] ")
  TextWindow.Write("Loaded ")
  TextWindow.Write(filename)
  TextWindow.WriteLine("")
  TextWindow.WriteLine("")
EndIf
  filenameubo = Controls.GetTextBoxText(fn2enter)
  Sound.Play(filename)
EndIf
If Controls.LastClickedButton = bttnpause Then
  If filename = filenameubo Then
    Sound.Pause(filename)
  Else
    Sound.Pause(filename)
    Sound.Pause(filenameubo)
  EndIf
EndIf
If Controls.LastClickedButton = bttnstop Then
    If filename = filenameubo Then
    Sound.Stop(filename)
  Else
    Sound.Stop(filename)
    Sound.Stop(filenameubo)
  EndIf
EndIf
  Goto begin

Hard to believe I'm 13, and I've learned quite a bit of Torque and Small Basic in one day. o_o

SMALL BASIC IMPORT CODE: PDT387
http://smallbasic.com/smallbasic.com/program/?PDT387
« Last Edit: July 28, 2010, 11:38:52 AM by TheBlackParrot »

Wow holy stuff this program is awesome :D

Wow holy stuff this program is awesome :D
And TERRIBLY glitchy, at that.


Nice work there.

Finally people are starting to make cool things in the only coding language I actually know.

Honestly, guys, what is this?

Updated, now it's a bit more stable.

Honestly, guys, what is this?
Music Player in Small Basic.
Screenshot below.

If I could, I add a crapton of ID3 tags to it, but Small Basic can't do it.
I may move over to VB Express tomorrow, since I have to update to SP3. THEN it might be possible.
« Last Edit: July 28, 2010, 02:28:14 AM by TheBlackParrot »

How do you compile it? I'm not familiar with Small Basic.

How do you compile it? I'm not familiar with Small Basic.
You... can't really compile it.
Sucks.

Then how do you turn the code into a program? Do you just make a .BAT file of it?

Then how do you turn the code into a program? Do you just make a .BAT file of it?
It's probably meant for embedding and what not.

Nice music player. I would like a better gui though. It looks very bland. But I understand it's still a work in progress.

Bump for an update to the code.
Flickr pictures can now be set as the background.