| Poster | Thread |
Allanon
|  |
Re: Hollywood Programming Project Posted on 23-Jan-2011 0:01:06
| | [ #21 ] |
|
|
 |
Member  |
Joined: 28-Jan-2009 Posts: 84
From: Unknown | | |
|
| --- sorry double post --- Last edited by Allanon on 23-Jan-2011 at 12:02 AM.
|
|
| Status: Offline |
|
|
Allanon
|  |
Re: Hollywood Programming Project Posted on 23-Jan-2011 0:02:04
| | [ #22 ] |
|
|
 |
Member  |
Joined: 28-Jan-2009 Posts: 84
From: Unknown | | |
|
| @1Mouse
Implementing a playlist is relative simple, you have to let the user select the mp3 tracks to insert in the playlist using the FileRequest command and store the mp3 files in a table, named for example "Playlist" :) one file for each entry so you should have:
Playlist[0] = "file1.mp3" Playlist[1] = "file2.mp3" and so on
To play this playlist look at this generic loop just as a start (because you can implement better using event handling):
Quote:
Local index = 0 Local entries = ... ; insert here the number of mp3 files in your Playlist table For song = index To entries - 1 Local music_id = OpenMusic(Nil, Playlist[song]) While IsMusicPlaying(music_id) Wait(10) ; you can do some stuff here like showing art, handle keypresses and so on... Wend
CloseMusic(music_id) Next
|
this is just a quick and dirt piece of code to let you start with something
|
|
| Status: Offline |
|
|
1Mouse
|  |
Re: Hollywood Programming Project Posted on 8-Jul-2012 18:48:48
| | [ #23 ] |
|
|
 |
Cult Member  |
Joined: 23-Jun-2005 Posts: 967
From: Bradford, West Yorkshire | | |
|
| @All
I had a minor set back a while ago and had a complete HD failure (didn't back-up, damn) so lost all my work.
About three/four weeks ago I decided to start again with my project and all is going reasonably well.
ID3 is a bit tricky, got it working on some mp3 files but then when I try to open others I get an error: Invalid Seek Position specified! (whatever that means.)
For example, I can load Prince Charming by Adam Ant and it displays Title: Prince Charming, Artist: Adam Ant, Album: Prince Charming, Year: 1981 & Genre: Pop.
I then try to load The Power by Cher and it replaces all the above information with the information for The Power, sounds good so far.
I then close my program and try to load The Power and get an error: Could not find text object 7!
I tried taking out all the code that reffered to the ID3 tags and all my mp3s will load with no problem, so ID3 is the problem.
If anyone wants to have a look at my code or help they are truly welcome. _________________ 2x A500 (1x 1MB) OS1.3 1x A600 (40MB HDD) OS2.05 2xA1200 (68020 8MB Fast RAM) OS3.9 1x CD³² 1 AmigaOne G4XE (OS4 Pre-Release Update4) Minimig Sam440ep + OS4.1.5 |
|
| Status: Offline |
|
|
g0blin
 |  |
Re: Hollywood Programming Project Posted on 8-Jul-2012 19:02:09
| | [ #24 ] |
|
|
 |
Regular Member  |
Joined: 31-Mar-2009 Posts: 302
From: Pisa, Italy | | |
|
| @1Mouse
I've been tinkering with Hollywood for a little while now. I got no experience with ID3, but I'd like to take a look at the code and experiment a little bit.
regards g0blin
PS: have you tried posting directly on Hollywood forum? Last edited by g0blin on 08-Jul-2012 at 07:07 PM.
_________________ Now running AmigaOS4.1.6 on Sam440-flex @800MHz. also running: Linux Debian 5 and Linux Kubuntu 12.04. AmigaForever2012 user. "iBatch" and "Boing Attitude" translation team. Amiga Translator's Organization. |
|
| Status: Offline |
|
|
1Mouse
|  |
Re: Hollywood Programming Project Posted on 8-Jul-2012 21:41:24
| | [ #25 ] |
|
|
 |
Cult Member  |
Joined: 23-Jun-2005 Posts: 967
From: Bradford, West Yorkshire | | |
|
| @g0blin
I have posted on the Hollywood forum in the past but I seem to get a faster and more consice response on here. _________________ 2x A500 (1x 1MB) OS1.3 1x A600 (40MB HDD) OS2.05 2xA1200 (68020 8MB Fast RAM) OS3.9 1x CD³² 1 AmigaOne G4XE (OS4 Pre-Release Update4) Minimig Sam440ep + OS4.1.5 |
|
| Status: Offline |
|
|
amigang
|  |
Re: Hollywood Programming Project Posted on 8-Jul-2012 22:12:23
| | [ #26 ] |
|
|
 |
Cult Member  |
Joined: 12-Jan-2005 Posts: 947
From: Cheshire, England | | |
|
| @1Mouse
I agree, I've only really just stared using Hollywood, and it is a pretty neat program, but I too would greatly befit from more tutorials.
I did find a few on os4 coding by djrikki http://www.os4coding.net/blogs/djrikki
But if anyone knows of more then let us know. _________________ AmigaNG, YouTube, Software |
|
| Status: Offline |
|
|
g0blin
 |  |
Re: Hollywood Programming Project Posted on 9-Jul-2012 7:27:08
| | [ #27 ] |
|
|
 |
Regular Member  |
Joined: 31-Mar-2009 Posts: 302
From: Pisa, Italy | | |
|
| @1Mouse
Sadly, you are right. As a matter of fact, when I find some major problem I usually e-mail the author directly. He always gave me a prompt response, but I do it only if I feel there is no other chance.
_________________ Now running AmigaOS4.1.6 on Sam440-flex @800MHz. also running: Linux Debian 5 and Linux Kubuntu 12.04. AmigaForever2012 user. "iBatch" and "Boing Attitude" translation team. Amiga Translator's Organization. |
|
| Status: Offline |
|
|
Pleng
|  |
Re: Hollywood Programming Project Posted on 9-Jul-2012 12:34:56
| | [ #28 ] |
|
|
 |
Regular Member  |
Joined: 17-Nov-2005 Posts: 395
From: Unknown | | |
|
| @1Mouse
Quote:
I then close my program and try to load The Power and get an error: Could not find text object 7!
|
Does Hollywood have any form of OnError, or Try/Catch? If so you could try something like this (pseudo code, you'll need to put the correct function names etc in)
Try albumName = getMP3Tag("album name") Catch albumName = "unknown" End Try
Try artist = getMP3Tag("artist") Catch artist = "unknown" End Try
etc etc |
|
| Status: Offline |
|
|
Templario
 |  |
Re: Hollywood Programming Project Posted on 9-Jul-2012 19:46:30
| | [ #29 ] |
|
|
 |
Elite Member  |
Joined: 22-Jun-2004 Posts: 2582
From: Palencia (capital of the mythical Vaccean Kingdom) | | |
|
| @1Mouse
There is a hidden problem with the mp3 files and the tag, besides the find inside them the Tag 3.1 and 3.2 someones has "extra info" as the cover in a picture in this zone, and it gives problems with the tag reader example of Hollywood, some solution to find free source code in C to resolve this cases. _________________ Amiga 500 with ROMs 1.3-2.05 and M-Tec AT 500 with hard disk and 4MB Ram. WinUAE + original OS 3.5&3.9 running on Intel Atom board. Sam440ep 600 MHZ (altmost dead). Sam440ep 733 MHZ. Sam460ex 1 GHz + OS 4.1 + Update 6. MacMini 1.5 GHz + MorphOS 3.1. |
|
| Status: Offline |
|
|
1Mouse
|  |
Re: Hollywood Programming Project Posted on 10-Jul-2012 12:16:13
| | [ #30 ] |
|
|
 |
Cult Member  |
Joined: 23-Jun-2005 Posts: 967
From: Bradford, West Yorkshire | | |
|
| YEAH
Another breakthrough, coverart sort of sorted.
I can get the coverart to display but only when saved on the HD but can't get it to download from net.
Having to load artwork from HD no great hardship though.
The album information is loaded using an album$ tag and just used the same tag to add artwork, so easy when you know how. _________________ 2x A500 (1x 1MB) OS1.3 1x A600 (40MB HDD) OS2.05 2xA1200 (68020 8MB Fast RAM) OS3.9 1x CD³² 1 AmigaOne G4XE (OS4 Pre-Release Update4) Minimig Sam440ep + OS4.1.5 |
|
| Status: Offline |
|
|
1Mouse
|  |
Re: Hollywood Programming Project Posted on 5-Aug-2012 9:56:40
| | [ #31 ] |
|
|
 |
Cult Member  |
Joined: 23-Jun-2005 Posts: 967
From: Bradford, West Yorkshire | | |
|
| Another coverart problem: I'd like to be able to load images from my HD via a $ in a text file.
I thought RawGet() so that it could check the text for $ and if $ exists then display corresponding image but if no image on HD then display default.
Am I on the right track? and if so can someone assist please? _________________ 2x A500 (1x 1MB) OS1.3 1x A600 (40MB HDD) OS2.05 2xA1200 (68020 8MB Fast RAM) OS3.9 1x CD³² 1 AmigaOne G4XE (OS4 Pre-Release Update4) Minimig Sam440ep + OS4.1.5 |
|
| Status: Offline |
|
|
djrikki
 |  |
Re: Hollywood Programming Project Posted on 5-Aug-2012 13:32:35
| | [ #32 ] |
|
|
 |
Super Member  |
Joined: 22-Jun-2010 Posts: 1807
From: Grimsby, UK | | |
|
| |
| Status: Offline |
|
|
1Mouse
|  |
Re: Hollywood Programming Project Posted on 6-Aug-2012 20:28:40
| | [ #33 ] |
|
|
 |
Cult Member  |
Joined: 23-Jun-2005 Posts: 967
From: Bradford, West Yorkshire | | |
|
| @djrikki
I've tried code: /*** Display Artwork**/ Local cover = OpenFile(Nil, album2$, #MODE_READ) While Not(Eof(cover)) Local picpath = ReadLine(cover) If Exists LoadBrush(4, album2$) ScaleBrush(4, 130, 130) DisplayBrush(4, 10, 10) Else DisplayBrush(9, 10, 10) EndIf Wend CloseFile(cover)
It opens a file when coverart is available however I'm still getting an error when it tries to open an MP3 that has no coverart.
Brush4 is the coverart and Brush9 is the default missing artwork image
I know for sure that there are no problems with the mp3s I'm using. _________________ 2x A500 (1x 1MB) OS1.3 1x A600 (40MB HDD) OS2.05 2xA1200 (68020 8MB Fast RAM) OS3.9 1x CD³² 1 AmigaOne G4XE (OS4 Pre-Release Update4) Minimig Sam440ep + OS4.1.5 |
|
| Status: Offline |
|
|
djrikki
 |  |
Re: Hollywood Programming Project Posted on 6-Aug-2012 22:33:52
| | [ #34 ] |
|
|
 |
Super Member  |
Joined: 22-Jun-2010 Posts: 1807
From: Grimsby, UK | | |
|
| @1Mouse
@djrikki
/*** Display Artwork**/ Local cover = OpenFile(Nil, album2$, #MODE_READ) While Not(Eof(cover)) Local picpath = ReadLine(cover) If Exists picpath /* u didnt state what u was trying to check existed /* LoadBrush(4, album2$) ScaleBrush(4, 130, 130) DisplayBrush(4, 10, 10) Else DisplayBrush(9, 10, 10) EndIf Wend CloseFile(cover)
Last edited by djrikki on 06-Aug-2012 at 10:36 PM. Last edited by djrikki on 06-Aug-2012 at 10:35 PM. Last edited by djrikki on 06-Aug-2012 at 10:35 PM.
_________________ Official AmigaOS Website AmigaOS on Facebook Lake Marketing and Events |
|
| Status: Offline |
|
|
1Mouse
|  |
Re: Hollywood Programming Project Posted on 11-Aug-2012 0:27:08
| | [ #35 ] |
|
|
 |
Cult Member  |
Joined: 23-Jun-2005 Posts: 967
From: Bradford, West Yorkshire | | |
|
| @Allanon
Thanks for checking over my code for the coverart problem I was having and sorting it out, wondered if it was possible to load the artwork from the same folder as the music.
I have my music layed out like iTunes with music files saved in folders for the album which are saved in folders for the artists.
Playlist problem still eludes me, still only able to load one file at a time, would love to be able to load multiple files (a whole album) and display them in a playlist and also be able to sort the files within the playlist.
I know I'm not asking for much
Errors with differing ID3 tags are also rather annoying, however I am able to change it so that I can open m4a files but tagging on these are different and these files do not display any track info or the artwork. _________________ 2x A500 (1x 1MB) OS1.3 1x A600 (40MB HDD) OS2.05 2xA1200 (68020 8MB Fast RAM) OS3.9 1x CD³² 1 AmigaOne G4XE (OS4 Pre-Release Update4) Minimig Sam440ep + OS4.1.5 |
|
| Status: Offline |
|
|
djrikki
 |  |
Re: Hollywood Programming Project Posted on 11-Aug-2012 1:03:00
| | [ #36 ] |
|
|
 |
Super Member  |
Joined: 22-Jun-2010 Posts: 1807
From: Grimsby, UK | | |
|
| |
| Status: Offline |
|
|
1Mouse
|  |
Re: Hollywood Programming Project Posted on 11-Aug-2012 1:07:38
| | [ #37 ] |
|
|
 |
Cult Member  |
Joined: 23-Jun-2005 Posts: 967
From: Bradford, West Yorkshire | | |
|
| @djrikki
It's ok, I can wait til Monday. A couple more days waiting for some help won't kill me _________________ 2x A500 (1x 1MB) OS1.3 1x A600 (40MB HDD) OS2.05 2xA1200 (68020 8MB Fast RAM) OS3.9 1x CD³² 1 AmigaOne G4XE (OS4 Pre-Release Update4) Minimig Sam440ep + OS4.1.5 |
|
| Status: Offline |
|
|
1Mouse
|  |
Re: Hollywood Programming Project Posted on 13-Aug-2012 17:13:29
| | [ #38 ] |
|
|
 |
Cult Member  |
Joined: 23-Jun-2005 Posts: 967
From: Bradford, West Yorkshire | | |
|
| Back to ID3 tags and no closer to a solution.
ID3 and code that works: ID3 TRCK 1/11 TIT2 Train TPE2 TPE1 4 Non Blondes TALB Bigger, Better, Faster, More! TYER 1993 TBPM TPOS TCON Alternative & Punk COMM eng TCOM TOPE TCOP
/*** ID3 tag reader*/ Function p_ReadSynchSafeInt(file) Local i = ReadInt(file) Return ((i & $7f) | ((i & $7f00) >> 1) | ((i & $7f0000) >> 2) | ((i & $7f000000) >> 3)) EndFunction
Function p_ReadTitle(f$) Local title$, album$, year$, genre$, track$ = "n/a", "n/a", "n/a", "n/a", "n/a", "n/a" OpenFile(1, f$, #MODE_READ) If ReadString(1, 3) = "ID3" Seek(1, 10) While title$ = "n/a" Or album$ = "n/a" Or year$ = "n/a" Or genre$ = "n/a" Or track$ = "n/a" Local tag$ = ReadString(1, 4) Local framelen = p_ReadSynchSafeInt(1) Seek(1, FilePos(1) + 2) ; skip flags /*** Get v2 Tags*/ If tag$ = "TIT2" Seek(1, FilePos(1) + 1) title$ = ReadString(1, framelen - 1) title2$ = title$ CreateTextObject(6, title$) ElseIf tag$ = "TPE1" Seek(1, FilePos(1) + 1) artist$ = ReadString(1, framelen - 1) artist2$ = artist$ CreateTextObject(7, artist$) ElseIf tag$ = "TALB" Seek(1, FilePos(1) + 1) album$ = ReadString(1, framelen - 1) album2$ = album$ CreateTextObject(8, album$) ElseIf tag$ = "TYER" Seek(1, FilePos(1) + 1) year$ = ReadString(1, framelen - 1) year2$ = year$ CreateTextObject(9, year$) ElseIf tag$ = "TCON" Seek(1, FilePos(1) + 1) genre$ = ReadString(1, framelen - 1) genre2$ = genre$ CreateTextObject(10, genre$) ElseIf tag$ = "TRCK" Seek(1, FilePos(1) + 1) track$ = ReadString(1, framelen - 1) track2$ = track$ CreateTextObject(12, track$) ElseIf StrLen(tag$) = 0 Break Else Seek(1, FilePos(1) + framelen) EndIf Wend
ID3 that doesn't work: ID3 TT2 Why (Radio Edit) TAL Why TRK 1/4 TPA 1/1 TYE 1996 TCO (13) COM eng TP1 3T COM eng3T Feat. Michael Jackson
I thought I could extended that with:
ElseIf ReadString(1, 3) = "ID3" Seek(1, 10) While title$ = "n/a" Or album$ = "n/a" Or year$ = "n/a" Or genre$ = "n/a" Or track$ = "n/a" Local tag$ = ReadString(1, 4) Local framelen = p_ReadSynchSafeInt(1) Seek(1, FilePos(1) + 2) ; skip flags /*** Get v2 Tags*/ If tag$ = "TT2" Seek(1, FilePos(1) + 1) title$ = ReadString(1, framelen - 1) title2$ = title$ CreateTextObject(6, title$) ElseIf tag$ = "TP1" Seek(1, FilePos(1) + 1) artist$ = ReadString(1, framelen - 1) artist2$ = artist$ CreateTextObject(7, artist$) ElseIf tag$ = "TAL" Seek(1, FilePos(1) + 1) album$ = ReadString(1, framelen - 1) album2$ = album$ CreateTextObject(8, album$) ElseIf tag$ = "TYE" Seek(1, FilePos(1) + 1) year$ = ReadString(1, framelen - 1) year2$ = year$ CreateTextObject(9, year$) ElseIf tag$ = "COM" Seek(1, FilePos(1) + 1) genre$ = ReadString(1, framelen - 1) genre2$ = genre$ CreateTextObject(10, genre$) ElseIf tag$ = "TPA" Seek(1, FilePos(1) + 1) track$ = ReadString(1, framelen - 1) track2$ = track$ CreateTextObject(12, track$) ElseIf StrLen(tag$) = 0 Break Else Seek(1, FilePos(1) + framelen) EndIf Wend
But no joy _________________ 2x A500 (1x 1MB) OS1.3 1x A600 (40MB HDD) OS2.05 2xA1200 (68020 8MB Fast RAM) OS3.9 1x CD³² 1 AmigaOne G4XE (OS4 Pre-Release Update4) Minimig Sam440ep + OS4.1.5 |
|
| Status: Offline |
|
|
djrikki
 |  |
Re: Hollywood Programming Project Posted on 13-Aug-2012 18:42:09
| | [ #39 ] |
|
|
 |
Super Member  |
Joined: 22-Jun-2010 Posts: 1807
From: Grimsby, UK | | |
|
| |
| Status: Offline |
|
|
djrikki
 |  |
Re: Hollywood Programming Project Posted on 13-Aug-2012 19:23:55
| | [ #40 ] |
|
|
 |
Super Member  |
Joined: 22-Jun-2010 Posts: 1807
From: Grimsby, UK | | |
|
| |
| Status: Offline |
|
|