Poster | Thread |
Allanon
| |
Re: Hollywood Programming Project Posted on 23-Jan-2011 0:01:06
| | [ #21 ] |
|
|
|
Regular Member |
Joined: 28-Jan-2009 Posts: 137
From: Unknown | | |
|
| |
Status: Offline |
|
|
Allanon
| |
Re: Hollywood Programming Project Posted on 23-Jan-2011 0:02:04
| | [ #22 ] |
|
|
|
Regular Member |
Joined: 28-Jan-2009 Posts: 137
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
_________________ ----- [Allanon] Fabio Falcucci AMC Website // Docs Site // Support Forum // => Patreon <= |
|
Status: Offline |
|
|
1Mouse
| |
Re: Hollywood Programming Project Posted on 8-Jul-2012 18:48:48
| | [ #23 ] |
|
|
|
Super Member |
Joined: 23-Jun-2005 Posts: 1356
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. _________________ 1 AmigaOne G4XE (OS4 Pre-Release Update4) Minimig Sam440ep + OS4.1FE Sam460cr + OS4.1FE |
|
Status: Offline |
|
|
g0blin
| |
Re: Hollywood Programming Project Posted on 8-Jul-2012 19:02:09
| | [ #24 ] |
|
|
|
Cult Member |
Joined: 31-Mar-2009 Posts: 666
From: Unknown | | |
|
| @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.
_________________ GDG Entertainment
Cybersphere Page |
|
Status: Offline |
|
|
1Mouse
| |
Re: Hollywood Programming Project Posted on 8-Jul-2012 21:41:24
| | [ #25 ] |
|
|
|
Super Member |
Joined: 23-Jun-2005 Posts: 1356
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. _________________ 1 AmigaOne G4XE (OS4 Pre-Release Update4) Minimig Sam440ep + OS4.1FE Sam460cr + OS4.1FE |
|
Status: Offline |
|
|
amigang
| |
Re: Hollywood Programming Project Posted on 8-Jul-2012 22:12:23
| | [ #26 ] |
|
|
|
Elite Member |
Joined: 12-Jan-2005 Posts: 2024
From: Cheshire, England | | |
|
| |
Status: Offline |
|
|
g0blin
| |
Re: Hollywood Programming Project Posted on 9-Jul-2012 7:27:08
| | [ #27 ] |
|
|
|
Cult Member |
Joined: 31-Mar-2009 Posts: 666
From: Unknown | | |
|
| @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.
_________________ GDG Entertainment
Cybersphere Page |
|
Status: Offline |
|
|
Pleng
| |
Re: Hollywood Programming Project Posted on 9-Jul-2012 12:34:56
| | [ #28 ] |
|
|
|
Regular Member |
Joined: 17-Nov-2005 Posts: 458
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: 3663
From: Unknown | | |
|
| @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. |
|
Status: Offline |
|
|
1Mouse
| |
Re: Hollywood Programming Project Posted on 10-Jul-2012 12:16:13
| | [ #30 ] |
|
|
|
Super Member |
Joined: 23-Jun-2005 Posts: 1356
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. _________________ 1 AmigaOne G4XE (OS4 Pre-Release Update4) Minimig Sam440ep + OS4.1FE Sam460cr + OS4.1FE |
|
Status: Offline |
|
|
1Mouse
| |
Re: Hollywood Programming Project Posted on 5-Aug-2012 9:56:40
| | [ #31 ] |
|
|
|
Super Member |
Joined: 23-Jun-2005 Posts: 1356
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? _________________ 1 AmigaOne G4XE (OS4 Pre-Release Update4) Minimig Sam440ep + OS4.1FE Sam460cr + OS4.1FE |
|
Status: Offline |
|
|
djrikki
| |
Re: Hollywood Programming Project Posted on 5-Aug-2012 13:32:35
| | [ #32 ] |
|
|
|
Elite Member |
Joined: 22-Jun-2010 Posts: 2077
From: Grimsby, UK | | |
|
| @1Mouse
See
Openfile()
Use For... Next and Readfile() loop contained in a loop
Close it afterwards _________________
|
|
Status: Offline |
|
|
1Mouse
| |
Re: Hollywood Programming Project Posted on 6-Aug-2012 20:28:40
| | [ #33 ] |
|
|
|
Super Member |
Joined: 23-Jun-2005 Posts: 1356
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. _________________ 1 AmigaOne G4XE (OS4 Pre-Release Update4) Minimig Sam440ep + OS4.1FE Sam460cr + OS4.1FE |
|
Status: Offline |
|
|
djrikki
| |
Re: Hollywood Programming Project Posted on 6-Aug-2012 22:33:52
| | [ #34 ] |
|
|
|
Elite Member |
Joined: 22-Jun-2010 Posts: 2077
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.
_________________
|
|
Status: Offline |
|
|
1Mouse
| |
Re: Hollywood Programming Project Posted on 11-Aug-2012 0:27:08
| | [ #35 ] |
|
|
|
Super Member |
Joined: 23-Jun-2005 Posts: 1356
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. _________________ 1 AmigaOne G4XE (OS4 Pre-Release Update4) Minimig Sam440ep + OS4.1FE Sam460cr + OS4.1FE |
|
Status: Offline |
|
|
djrikki
| |
Re: Hollywood Programming Project Posted on 11-Aug-2012 1:03:00
| | [ #36 ] |
|
|
|
Elite Member |
Joined: 22-Jun-2010 Posts: 2077
From: Grimsby, UK | | |
|
| @1Mouse
I use the Python module Mutagen for extracting artwork. Cannot remember exact way to read/write the ID3 tags off the top of my head (away from my computer).
If you cannot wait till Monday check out the python files in the Jack distribution. _________________
|
|
Status: Offline |
|
|
1Mouse
| |
Re: Hollywood Programming Project Posted on 11-Aug-2012 1:07:38
| | [ #37 ] |
|
|
|
Super Member |
Joined: 23-Jun-2005 Posts: 1356
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 _________________ 1 AmigaOne G4XE (OS4 Pre-Release Update4) Minimig Sam440ep + OS4.1FE Sam460cr + OS4.1FE |
|
Status: Offline |
|
|
1Mouse
| |
Re: Hollywood Programming Project Posted on 13-Aug-2012 17:13:29
| | [ #38 ] |
|
|
|
Super Member |
Joined: 23-Jun-2005 Posts: 1356
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 _________________ 1 AmigaOne G4XE (OS4 Pre-Release Update4) Minimig Sam440ep + OS4.1FE Sam460cr + OS4.1FE |
|
Status: Offline |
|
|
djrikki
| |
Re: Hollywood Programming Project Posted on 13-Aug-2012 18:42:09
| | [ #39 ] |
|
|
|
Elite Member |
Joined: 22-Jun-2010 Posts: 2077
From: Grimsby, UK | | |
|
| @1Mouse
Off back to the office soon for an Amiga session. First job when I get back. _________________
|
|
Status: Offline |
|
|
djrikki
| |
Re: Hollywood Programming Project Posted on 13-Aug-2012 19:23:55
| | [ #40 ] |
|
|
|
Elite Member |
Joined: 22-Jun-2010 Posts: 2077
From: Grimsby, UK | | |
|
| |
Status: Offline |
|
|