Default Artwork if No Other

Find quick help here to get you started with Hollywood
User avatar
1Mouse
Posts: 63
Joined: Sat Sep 11, 2010 9:27 pm

Default Artwork if No Other

Post by 1Mouse »

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 the 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?
User avatar
Allanon
Posts: 732
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: Default Artwork if No Other

Post by Allanon »

Hi 1mouse,
to be honest I don't understand what do you mean with $, maybe a placeholder for the file to display in an external file?

If so you could structure a text file with your picture file entries, and place a default picture somewhere:

Suppose that:
text file with your images full path is : mypictures.txt
you default picture is : mydefaultpicture.jpg

Code: Select all

; *** simple loop/idea could be: ***

Local fid = FileOpen(Nil, "myprictures.txt", #MODE_READ)

While Not(Eof(fid))
   Local picpath = ReadLine(fid)
   If Exists(picpath)
      ; ---- HERE YOU PLACE YOUR CODE TO LOAD AND DISPLAY THE PICTURE <PICPATH>
   Else
      ; ---- HERE YOU PLACE YOUR CODE TO DISPLAY THE DEFAULT PICTURE <mydefaultpicture.jpg>
   EndIf
Wend

CloseFile(fid)

This is just an idea so you have something you can start working on :)
User avatar
1Mouse
Posts: 63
Joined: Sat Sep 11, 2010 9:27 pm

Re: Default Artwork if No Other

Post by 1Mouse »

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.
User avatar
Allanon
Posts: 732
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: Default Artwork if No Other

Post by Allanon »

Hi 1Mouse,
I will help you, but you have to help me understand what you are trying to do because your code is not clear to me :)
Please explain how you have organized the project, for example, album2$ what's supposed to store? The cover art file or the cover art filename?
Talking about MP3s, in which way you connect music with cover art?
User avatar
1Mouse
Posts: 63
Joined: Sat Sep 11, 2010 9:27 pm

Re: Default Artwork if No Other

Post by 1Mouse »

I've used the ID3.hws routine and the tag in the ID3 is TALB, I used:
CreateTextObject(7, artist$)
ElseIf tag$ = "TALB"
Seek(1, FilePos(1) + 1) ; skip encoding
album$ = ReadString(1, framelen - 1)
album2$ = album$

album$ (becomes TextObject) is used to display the album title in text form and album2$ (becomes Brush) is used for the coverart which is save on the HD

So when I load an mp3 it reads the ID3 tag and displays text which is album$ and displays coverart which is album2$ which all works, however if the coverart isn't in the same folder then I get an error: Cannot Read File
User avatar
1Mouse
Posts: 63
Joined: Sat Sep 11, 2010 9:27 pm

Re: Default Artwork if No Other

Post by 1Mouse »

@all

I've advanced a little since 2012, however not as far as expected.

My Intune program now loads coverart when available and default artwork if none available, however I can't put the coverart in the same folder as the music it has to be in the root.

I get an error when the Mp3 ID3 tag has missing metadata, if the artist/album/track data is missing I get an error. If I load a track with all the data it plays fine and load a file with missing data that plays but on restart loading the file with missing data gives me an error.
User avatar
Juan Carlos
Posts: 887
Joined: Mon Sep 06, 2010 1:02 pm

Re: Default Artwork if No Other

Post by Juan Carlos »

We have more examples like other languages this is the Hollywood problem, even I tryed to convert visual basic, javascrit and c but the language structure is very different and only with easy routines is possible, in my case I make different proyects to avoid stopped and leave this language, with beatyful examples but no useful to make normal apps.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Default Artwork if No Other

Post by airsoftsoftwair »

Keep in mind that the ID3.hws code from HollyAmp is a really, really rudimentary ID3 parser. It certainly doesn't handle all the intricacies of ID3 tags. This code needs a lot of improvement in order to be compatible with all ID3 features...
User avatar
1Mouse
Posts: 63
Joined: Sat Sep 11, 2010 9:27 pm

Re: Default Artwork if No Other

Post by 1Mouse »

At present if there is missing ID3 metadata I get an error rather than my software displaying nothing
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Default Artwork if No Other

Post by airsoftsoftwair »

Maybe the ID3 recognizer isn't that stable... as I said, that code really implements just a rudimentary parser...
Post Reply